reference/mysqli/mysqli/get-proto-info.xml
3e82f503089be04094e8989486ed245d6b6e1a6b
...
...
@@ -2,26 +2,23 @@
2
2
<!-- $Revision$ -->
3
3
<refentry xml:id="mysqli.get-proto-info" xmlns="http://docbook.org/ns/docbook">
4
4
<refnamediv>
5
-
<refname>mysqli->protocol_version</refname>
5
+
<refname>mysqli::$protocol_version</refname>
6
6
<refname>mysqli_get_proto_info</refname>
7
7
<refpurpose>Returns the version of the MySQL protocol used</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>protocol_version</varname></fieldsynopsis>
16
-
</classsynopsis>
17
-
<para>Procedural style:</para>
12
+
<para>&style.oop;</para>
13
+
<fieldsynopsis><type>int</type><varname linkend="mysqli.get-proto-info">mysqli-&gt;protocol_version</varname></fieldsynopsis>
14
+
<para>&style.procedural;</para>
18
15
<methodsynopsis>
19
16
<type>int</type><methodname>mysqli_get_proto_info</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 an integer representing the MySQL protocol version used by the
24
-
connection represented by the <parameter>link</parameter> parameter.
21
+
connection represented by the <parameter>mysql</parameter> parameter.
25
22
</para>
26
23
</refsect1>
27
24

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

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

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

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

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

81
65
/* print protocol version */
82
66
printf("Protocol version: %d\n", mysqli_get_proto_info($link));
83
-

84
-
/* close connection */
85
-
mysqli_close($link);
86
-
?>
87
67
]]>
88
68
</programlisting>
89
-
</example>
90
-
&example.outputs;
91
-
<screen>
69
+
&examples.outputs;
70
+
<screen>
92
71
<![CDATA[
93
72
Protocol version: 10
94
73
]]>
95
-
</screen>
74
+
</screen>
75
+
</example>
96
76
</refsect1>
97
77

98
78
<refsect1 role="seealso">
...
...
@@ -105,7 +85,6 @@ Protocol version: 10
105
85
</refsect1>
106
86

107
87
</refentry>
108
-

109
88
<!-- Keep this comment at the end of the file
110
89
Local variables:
111
90
mode: sgml
112
91