reference/mysqli/mysqli/get-server-info.xml
1a7e56aa81712964a7f1984617e9fbcd0b33dcb5
...
...
@@ -2,22 +2,24 @@
2
2
<!-- $Revision$ -->
3
3
<refentry xml:id="mysqli.get-server-info" xmlns="http://docbook.org/ns/docbook">
4
4
<refnamediv>
5
-
<refname>mysqli->server_info</refname>
5
+
<refname>mysqli::$server_info</refname>
6
+
<refname>mysqli::get_server_info</refname>
6
7
<refname>mysqli_get_server_info</refname>
7
8
<refpurpose>Returns the version of the MySQL server</refpurpose>
8
9
</refnamediv>
9
10

10
11
<refsect1 role="description">
11
12
&reftitle.description;
12
-
<para>Object oriented style (property):</para>
13
-
<classsynopsis>
14
-
<ooclass><classname>mysqli</classname></ooclass>
15
-
<fieldsynopsis><type>string</type><varname>server_info</varname></fieldsynopsis>
16
-
</classsynopsis>
17
-
<para>Procedural style:</para>
13
+
<para>&style.oop;</para>
14
+
<fieldsynopsis><type>string</type><varname linkend="mysqli.get-server-info">mysqli-&gt;server_info</varname></fieldsynopsis>
15
+
<methodsynopsis role="mysqli">
16
+
<modifier>public</modifier> <type>string</type><methodname>mysqli::get_server_info</methodname>
17
+
<void/>
18
+
</methodsynopsis>
19
+
<para>&style.procedural;</para>
18
20
<methodsynopsis>
19
21
<type>string</type><methodname>mysqli_get_server_info</methodname>
20
-
<methodparam><type>mysqli</type><parameter>link</parameter></methodparam>
22
+
<methodparam><type>mysqli</type><parameter>mysql</parameter></methodparam>
21
23
</methodsynopsis>
22
24
<para>
23
25
Returns a string representing the version of the MySQL server that the
...
...
@@ -44,55 +46,38 @@
44
46
<refsect1 role="examples">
45
47
&reftitle.examples;
46
48
<example>
47
-
<title>Object oriented style</title>
49
+
<title><varname>$mysqli-&gt;server_info</varname> example</title>
50
+
<para>&style.oop;</para>
48
51
<programlisting role="php">
49
52
<![CDATA[
50
53
<?php
51
-
$mysqli = new mysqli("localhost", "my_user", "my_password");
52
54

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

59
58
/* print server version */
60
59
printf("Server version: %s\n", $mysqli->server_info);
61
-

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

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

81
70
/* print server version */
82
71
printf("Server version: %s\n", mysqli_get_server_info($link));
83
-

84
-
/* close connection */
85
-
mysqli_close($link);
86
-
?>
87
72
]]>
88
73
</programlisting>
89
-
</example>
90
-
&example.outputs;
91
-
<screen>
74
+
&examples.outputs.similar;
75
+
<screen>
92
76
<![CDATA[
93
-
Server version: 4.1.2-alpha-debug
77
+
Server version: 8.0.21
94
78
]]>
95
-
</screen>
79
+
</screen>
80
+
</example>
96
81
</refsect1>
97
82

98
83
<refsect1 role="seealso">
...
...
@@ -107,7 +92,6 @@ Server version: 4.1.2-alpha-debug
107
92
</refsect1>
108
93

109
94
</refentry>
110
-

111
95
<!-- Keep this comment at the end of the file
112
96
Local variables:
113
97
mode: sgml
114
98