reference/mysqli/mysqli/get-proto-info.xml
3e82f503089be04094e8989486ed245d6b6e1a6b
...
...
@@ -10,15 +10,15 @@
10
10
<refsect1 role="description">
11
11
&reftitle.description;
12
12
<para>&style.oop;</para>
13
-
<fieldsynopsis><type>string</type><varname linkend="mysqli.get-proto-info">mysqli->protocol_version</varname></fieldsynopsis>
13
+
<fieldsynopsis><type>int</type><varname linkend="mysqli.get-proto-info">mysqli-&gt;protocol_version</varname></fieldsynopsis>
14
14
<para>&style.procedural;</para>
15
15
<methodsynopsis>
16
16
<type>int</type><methodname>mysqli_get_proto_info</methodname>
17
-
<methodparam><type>mysqli</type><parameter>link</parameter></methodparam>
17
+
<methodparam><type>mysqli</type><parameter>mysql</parameter></methodparam>
18
18
</methodsynopsis>
19
19
<para>
20
20
Returns an integer representing the MySQL protocol version used by the
21
-
connection represented by the <parameter>link</parameter> parameter.
21
+
connection represented by the <parameter>mysql</parameter> parameter.
22
22
</para>
23
23
</refsect1>
24
24

...
...
@@ -41,45 +41,29 @@
41
41
<refsect1 role="examples">
42
42
&reftitle.examples;
43
43
<example>
44
-
<title><varname>$mysqli->protocol_version</varname> example</title>
44
+
<title><varname>$mysqli-&gt;protocol_version</varname> example</title>
45
45
<para>&style.oop;</para>
46
46
<programlisting role="php">
47
47
<![CDATA[
48
48
<?php
49
-
$mysqli = new mysqli("localhost", "my_user", "my_password");
50
49

51
-
/* check connection */
52
-
if (mysqli_connect_errno()) {
53
-
printf("Connect failed: %s\n", mysqli_connect_error());
54
-
exit();
55
-
}
50
+
mysqli_report(MYSQLI_REPORT_ERROR | MYSQLI_REPORT_STRICT);
51
+
$mysqli = new mysqli("localhost", "my_user", "my_password");
56
52

57
53
/* print protocol version */
58
54
printf("Protocol version: %d\n", $mysqli->protocol_version);
59
-

60
-
/* close connection */
61
-
$mysqli->close();
62
-
?>
63
55
]]>
64
56
</programlisting>
65
57
<para>&style.procedural;</para>
66
58
<programlisting role="php">
67
59
<![CDATA[
68
60
<?php
69
-
$link = mysqli_connect("localhost", "my_user", "my_password");
70
61

71
-
/* check connection */
72
-
if (mysqli_connect_errno()) {
73
-
printf("Connect failed: %s\n", mysqli_connect_error());
74
-
exit();
75
-
}
62
+
mysqli_report(MYSQLI_REPORT_ERROR | MYSQLI_REPORT_STRICT);
63
+
$link = mysqli_connect("localhost", "my_user", "my_password");
76
64

77
65
/* print protocol version */
78
66
printf("Protocol version: %d\n", mysqli_get_proto_info($link));
79
-

80
-
/* close connection */
81
-
mysqli_close($link);
82
-
?>
83
67
]]>
84
68
</programlisting>
85
69
&examples.outputs;
...
...
@@ -101,7 +85,6 @@ Protocol version: 10
101
85
</refsect1>
102
86

103
87
</refentry>
104
-

105
88
<!-- Keep this comment at the end of the file
106
89
Local variables:
107
90
mode: sgml
108
91