reference/mysqli/mysqli/error.xml
7e5d0d1bb69180c9de1992edf9613215c975fa57
...
...
@@ -2,22 +2,19 @@
2
2
<!-- $Revision$ -->
3
3
<refentry xml:id="mysqli.error" xmlns="http://docbook.org/ns/docbook">
4
4
<refnamediv>
5
-
<refname>mysqli->error</refname>
5
+
<refname>mysqli::$error</refname>
6
6
<refname>mysqli_error</refname>
7
7
<refpurpose>Returns a string description of the last error</refpurpose>
8
8
</refnamediv>
9
9

10
10
<refsect1 role="description">
11
11
&reftitle.description;
12
-
<para>Object oriented style (property):</para>
13
-
<classsynopsis>
14
-
<ooclass><classname>mysqli</classname></ooclass>
15
-
<fieldsynopsis><type>string</type><varname>error</varname></fieldsynopsis>
16
-
</classsynopsis>
17
-
<para>Procedural style:</para>
12
+
<para>&style.oop;</para>
13
+
<fieldsynopsis><type>string</type><varname linkend="mysqli.error">mysqli-&gt;error</varname></fieldsynopsis>
14
+
<para>&style.procedural;</para>
18
15
<methodsynopsis>
19
16
<type>string</type><methodname>mysqli_error</methodname>
20
-
<methodparam><type>mysqli</type><parameter>link</parameter></methodparam>
17
+
<methodparam><type>mysqli</type><parameter>mysql</parameter></methodparam>
21
18
</methodsynopsis>
22
19
<para>
23
20
Returns the last error message for the most recent MySQLi function call
...
...
@@ -44,30 +41,29 @@
44
41
<refsect1 role="examples">
45
42
&reftitle.examples;
46
43
<example>
47
-
<title>Object oriented style</title>
44
+
<title><varname>$mysqli-&gt;error</varname> example</title>
45
+
<para>&style.oop;</para>
48
46
<programlisting role="php">
49
47
<![CDATA[
50
48
<?php
51
49
$mysqli = new mysqli("localhost", "my_user", "my_password", "world");
52
50

53
51
/* check connection */
54
-
if (mysqli_connect_errno()) {
55
-
printf("Connect failed: %s\n", mysqli_connect_error());
52
+
if ($mysqli->connect_errno) {
53
+
printf("Connect failed: %s\n", $mysqli->connect_error);
56
54
exit();
57
55
}
58
56

59
57
if (!$mysqli->query("SET a=1")) {
60
-
printf("Errormessage: %s\n", $mysqli->error);
58
+
printf("Error message: %s\n", $mysqli->error);
61
59
}
62
60

63
61
/* close connection */
64
62
$mysqli->close();
65
63
?>
66
64
]]>
67
-
</programlisting>
68
-
</example>
69
-
<example>
70
-
<title>Procedural style</title>
65
+
</programlisting>
66
+
<para>&style.procedural;</para>
71
67
<programlisting role="php">
72
68
<![CDATA[
73
69
<?php
...
...
@@ -80,7 +76,7 @@ if (mysqli_connect_errno()) {
80
76
}
81
77

82
78
if (!mysqli_query($link, "SET a=1")) {
83
-
printf("Errormessage: %s\n", mysqli_error($link));
79
+
printf("Error message: %s\n", mysqli_error($link));
84
80
}
85
81

86
82
/* close connection */
...
...
@@ -88,13 +84,13 @@ mysqli_close($link);
88
84
?>
89
85
]]>
90
86
</programlisting>
91
-
</example>
92
-
&example.outputs;
93
-
<screen>
87
+
&examples.outputs;
88
+
<screen>
94
89
<![CDATA[
95
-
Errormessage: Unknown system variable 'a'
90
+
Error message: Unknown system variable 'a'
96
91
]]>
97
-
</screen>
92
+
</screen>
93
+
</example>
98
94
</refsect1>
99
95

100
96
<refsect1 role="seealso">
...
...
@@ -110,7 +106,6 @@ Errormessage: Unknown system variable 'a'
110
106
</refsect1>
111
107

112
108
</refentry>
113
-

114
109
<!-- Keep this comment at the end of the file
115
110
Local variables:
116
111
mode: sgml
117
112