reference/mysqli/mysqli/commit.xml
63b99082ef83eade08151f8cb528246fded81db9
...
...
@@ -10,17 +10,17 @@
10
10
<refsect1 role="description">
11
11
&reftitle.description;
12
12
<para>&style.oop;</para>
13
-
<methodsynopsis role="oop">
14
-
<type>bool</type><methodname>mysqli::commit</methodname>
15
-
<methodparam choice="opt"><type>int</type><parameter>flags</parameter></methodparam>
16
-
<methodparam choice="opt"><type>string</type><parameter>name</parameter></methodparam>
13
+
<methodsynopsis role="mysqli">
14
+
<modifier>public</modifier> <type>bool</type><methodname>mysqli::commit</methodname>
15
+
<methodparam choice="opt"><type>int</type><parameter>flags</parameter><initializer>0</initializer></methodparam>
16
+
<methodparam choice="opt"><type class="union"><type>string</type><type>null</type></type><parameter>name</parameter><initializer>&null;</initializer></methodparam>
17
17
</methodsynopsis>
18
18
<para>&style.procedural;</para>
19
19
<methodsynopsis>
20
20
<type>bool</type><methodname>mysqli_commit</methodname>
21
-
<methodparam><type>mysqli</type><parameter>link</parameter></methodparam>
22
-
<methodparam choice="opt"><type>int</type><parameter>flags</parameter></methodparam>
23
-
<methodparam choice="opt"><type>string</type><parameter>name</parameter></methodparam>
21
+
<methodparam><type>mysqli</type><parameter>mysql</parameter></methodparam>
22
+
<methodparam choice="opt"><type>int</type><parameter>flags</parameter><initializer>0</initializer></methodparam>
23
+
<methodparam choice="opt"><type class="union"><type>string</type><type>null</type></type><parameter>name</parameter><initializer>&null;</initializer></methodparam>
24
24
</methodsynopsis>
25
25
<para>
26
26
Commits the current transaction for the database connection.
...
...
@@ -59,6 +59,11 @@
59
59
</para>
60
60
</refsect1>
61
61

62
+
<refsect1 role="errors">
63
+
&reftitle.errors;
64
+
&mysqli.conditionalexception;
65
+
</refsect1>
66
+

62
67
<refsect1 role="changelog">
63
68
&reftitle.changelog;
64
69
<para>
...
...
@@ -72,10 +77,9 @@
72
77
</thead>
73
78
<tbody>
74
79
<row>
75
-
<entry>5.5.0</entry>
80
+
<entry>8.0.0</entry>
76
81
<entry>
77
-
Added <parameter>flags</parameter> and <parameter>name</parameter>
78
-
parameters.
82
+
<parameter>name</parameter> is now nullable.
79
83
</entry>
80
84
</row>
81
85
</tbody>
...
...
@@ -86,76 +90,19 @@
86
90

87
91
<refsect1 role="examples">
88
92
&reftitle.examples;
89
-
<example>
90
-
<title><methodname>mysqli::commit</methodname> example</title>
91
-
<para>&style.oop;</para>
92
-
<programlisting role="php">
93
-
<![CDATA[
94
-
<?php
95
-
$mysqli = new mysqli("localhost", "my_user", "my_password", "world");
96
-

97
-
/* check connection */
98
-
if (mysqli_connect_errno()) {
99
-
printf("Connect failed: %s\n", mysqli_connect_error());
100
-
exit();
101
-
}
102
-

103
-
$mysqli->query("CREATE TABLE Language LIKE CountryLanguage");
104
-

105
-
/* set autocommit to off */
106
-
$mysqli->autocommit(FALSE);
107
-

108
-
/* Insert some values */
109
-
$mysqli->query("INSERT INTO Language VALUES ('DEU', 'Bavarian', 'F', 11.2)");
110
-
$mysqli->query("INSERT INTO Language VALUES ('DEU', 'Swabian', 'F', 9.4)");
111
-

112
-
/* commit transaction */
113
-
if (!$mysqli->commit()) {
114
-
print("Transaction commit failed\n");
115
-
exit();
116
-
}
117
-

118
-
/* drop table */
119
-
$mysqli->query("DROP TABLE Language");
120
-

121
-
/* close connection */
122
-
$mysqli->close();
123
-
?>
124
-
]]>
125
-
</programlisting>
126
-
<para>&style.procedural;</para>
127
-
<programlisting role="php">
128
-
<![CDATA[
129
-
<?php
130
-
$link = mysqli_connect("localhost", "my_user", "my_password", "test");
131
-

132
-
/* check connection */
133
-
if (!$link) {
134
-
printf("Connect failed: %s\n", mysqli_connect_error());
135
-
exit();
136
-
}
137
-

138
-
/* set autocommit to off */
139
-
mysqli_autocommit($link, FALSE);
140
-

141
-
mysqli_query($link, "CREATE TABLE Language LIKE CountryLanguage");
142
-

143
-
/* Insert some values */
144
-
mysqli_query($link, "INSERT INTO Language VALUES ('DEU', 'Bavarian', 'F', 11.2)");
145
-
mysqli_query($link, "INSERT INTO Language VALUES ('DEU', 'Swabian', 'F', 9.4)");
146
-

147
-
/* commit transaction */
148
-
if (!mysqli_commit($link)) {
149
-
print("Transaction commit failed\n");
150
-
exit();
151
-
}
93
+
<para>
94
+
See the <link linkend="mysqli.begin-transaction.example.basic"><methodname>mysqli::begin_transaction</methodname> example</link>.
95
+
</para>
96
+
</refsect1>
152
97

153
-
/* close connection */
154
-
mysqli_close($link);
155
-
?>
156
-
]]>
157
-
</programlisting>
158
-
</example>
98
+
<refsect1 role="notes">
99
+
&reftitle.notes;
100
+
<note>
101
+
<para>
102
+
This function does not work with non transactional table types (like
103
+
MyISAM or ISAM).
104
+
</para>
105
+
</note>
159
106
</refsect1>
160
107

161
108
<refsect1 role="seealso">
...
...
@@ -171,7 +118,6 @@ mysqli_close($link);
171
118
</refsect1>
172
119

173
120
</refentry>
174
-

175
121
<!-- Keep this comment at the end of the file
176
122
Local variables:
177
123
mode: sgml
178
124