cvs: phpdoc /en/reference/mysqli/functions mysqli-get-client-info.xml mysqli-get-client-version.xml mysqli-get-host-info.xml mysqli-get-metadata.xml
mysqli-get-proto-info.xml mysqli-report.xml

From: Date: Sun, 22 Feb 2004 21:46:41 +0000
Subject: cvs: phpdoc /en/reference/mysqli/functions mysqli-get-client-info.xml mysqli-get-client-version.xml mysqli-get-host-info.xml mysqli-get-metadata.xml
mysqli-get-proto-info.xml mysqli-report.xml
Groups: php.doc 
Request: Send a blank email to phpdoc+get-969359152@lists.php.net to get a copy of this message
georg Sun Feb 22 16:46:41 2004 EDT Modified files: /phpdoc/en/reference/mysqli/functions mysqli-get-client-info.xml mysqli-get-client-version.xml mysqli-get-host-info.xml mysqli-get-metadata.xml mysqli-get-proto-info.xml mysqli-report.xml Log: - added more samples - minor fixes

http://cvs.php.net/diff.php/phpdoc/en/reference/mysqli/functions/mysqli-get-client-info.xml?r1=1.4&r2=1.5&ty=u Index: phpdoc/en/reference/mysqli/functions/mysqli-get-client-info.xml diff -u phpdoc/en/reference/mysqli/functions/mysqli-get-client-info.xml:1.4 phpdoc/en/reference/mysqli/functions/mysqli-get-client-info.xml:1.5 --- phpdoc/en/reference/mysqli/functions/mysqli-get-client-info.xml:1.4 Wed Jan 28 18:18:42 2004 +++ phpdoc/en/reference/mysqli/functions/mysqli-get-client-info.xml Sun Feb 22 16:46:41 2004 @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="iso-8859-1"?> -<!-- $Revision: 1.4 $ --> +<!-- $Revision: 1.5 $ --> <refentry id="function.mysqli-get-client-info"> <refnamediv> <refname>mysqli_get_client_info</refname> @@ -24,11 +24,32 @@ </para> </refsect1> <refsect1> - &reftitle.seealso; + <title>See also</title> <para> - <function>mysqli_get_client_version</function> + <function>mysqli_get_client_version</function>, + <function>mysqli_get_server_info</function>, + <function>mysqli_get_server_version</function> </para> </refsect1> + <refsect1> + <title>Example</title> + <para> + <example> + <title>mysqli_get_client_info</title> + <programlisting role='php'> +<![CDATA[ +<?php + +/* We don't need a connection to determine + the version of mysql client library */ + +printf("Client library version: %s\n", mysqli_get_client_info()); +?> +]]> + </programlisting> + </example> + </para> + </refsect1> </refentry> <!-- Keep this comment at the end of the file http://cvs.php.net/diff.php/phpdoc/en/reference/mysqli/functions/mysqli-get-client-version.xml?r1=1.1&r2=1.2&ty=u Index: phpdoc/en/reference/mysqli/functions/mysqli-get-client-version.xml diff -u phpdoc/en/reference/mysqli/functions/mysqli-get-client-version.xml:1.1 phpdoc/en/reference/mysqli/functions/mysqli-get-client-version.xml:1.2 --- phpdoc/en/reference/mysqli/functions/mysqli-get-client-version.xml:1.1 Sun Feb 8 08:38:38 2004 +++ phpdoc/en/reference/mysqli/functions/mysqli-get-client-version.xml Sun Feb 22 16:46:41 2004 @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="iso-8859-1"?> -<!-- $Revision: 1.1 $ --> +<!-- $Revision: 1.2 $ --> <refentry id="function.mysqli_get_client_version"> <refnamediv> <refname>mysqli_get_client_version</refname> @@ -11,9 +11,48 @@ <type>int</type><methodname>mysqli_get_client_version</methodname> <void/> </methodsynopsis> + <para> + Returns client version number as an integer. + </para> + </refsect1> + <refsect1> + <title>Return values</title> + <para> + A number that represents the MySQL client library version in format: + <literal>main_version*10000 + minor_version *100 + sub_version</literal>. + For example, 4.1.0 is returned as 40100. + </para> + <para> + This is useful to quickly determine the version of the client library + to know if some capability exits. + </para> + </refsect1> + <refsect1> + <title>See also</title> + <para> + <function>mysqli_get_client_info</function>, + <function>mysqli_get_server_info</function>, + <function>mysqli_get_server_version</function> + </para> + </refsect1> + <refsect1> + <title>Example</title> + <para> + <example> + <title>mysqli_get_client_version</title> + <programlisting role='php'> +<![CDATA[ +<?php - &warn.undocumented.func; +/* We don't need a connection to determine + the version of mysql client library */ +printf("Client library version: %d\n", mysqli_get_client_version()); +?> +]]> + </programlisting> + </example> + </para> </refsect1> </refentry> http://cvs.php.net/diff.php/phpdoc/en/reference/mysqli/functions/mysqli-get-host-info.xml?r1=1.4&r2=1.5&ty=u Index: phpdoc/en/reference/mysqli/functions/mysqli-get-host-info.xml diff -u phpdoc/en/reference/mysqli/functions/mysqli-get-host-info.xml:1.4 phpdoc/en/reference/mysqli/functions/mysqli-get-host-info.xml:1.5 --- phpdoc/en/reference/mysqli/functions/mysqli-get-host-info.xml:1.4 Wed Jan 28 18:18:42 2004 +++ phpdoc/en/reference/mysqli/functions/mysqli-get-host-info.xml Sun Feb 22 16:46:41 2004 @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="iso-8859-1"?> -<!-- $Revision: 1.4 $ --> +<!-- $Revision: 1.5 $ --> <refentry id="function.mysqli-get-host-info"> <refnamediv> <refname>mysqli_get_host_info</refname> @@ -31,11 +31,48 @@ </para> </refsect1> <refsect1> - &reftitle.seealso; + <title>See also</title> <para> <function>mysqli_get_proto_info</function> </para> </refsect1> + <refsect1> + <title>Example</title> + <para> + <example> + <title>Object oriented style</title> + <programlisting role='php'> +<![CDATA[ +<?php +$mysqli = new mysqli("localhost", "my_user", "my_password"); + +/* print host information */ +printf("Host info: %s\n", $mysqli->host_info); + +/* close connection */ +$mysqli->close(); +?> +]]> + </programlisting> + </example> + <example> + <title>Procedural style</title> + <programlisting role='php'> +<![CDATA[ +<?php +$link = mysqli_connect("localhost", "my_user", "my_password"); + +/* print host information */ +printf("Host info: %s\n", mysqli_get_host_info($link)); + +/* close connection */ +mysqli_close($link); +?> +]]> + </programlisting> + </example> + </para> + </refsect1> </refentry> <!-- Keep this comment at the end of the file http://cvs.php.net/diff.php/phpdoc/en/reference/mysqli/functions/mysqli-get-metadata.xml?r1=1.2&r2=1.3&ty=u Index: phpdoc/en/reference/mysqli/functions/mysqli-get-metadata.xml diff -u phpdoc/en/reference/mysqli/functions/mysqli-get-metadata.xml:1.2 phpdoc/en/reference/mysqli/functions/mysqli-get-metadata.xml:1.3 --- phpdoc/en/reference/mysqli/functions/mysqli-get-metadata.xml:1.2 Fri Feb 20 09:45:50 2004 +++ phpdoc/en/reference/mysqli/functions/mysqli-get-metadata.xml Sun Feb 22 16:46:41 2004 @@ -1,9 +1,9 @@ <?xml version="1.0" encoding="iso-8859-1"?> -<!-- $Revision: 1.2 $ --> +<!-- $Revision: 1.3 $ --> <refentry id="function.mysqli-get-metadata"> <refnamediv> <refname>mysqli_get_metadata</refname> - <refpurpose></refpurpose> + <refpurpose>returns result set metadata from a prepared statement</refpurpose> </refnamediv> <refsect1> <title>Description</title> @@ -68,6 +68,75 @@ <function>mysqli_free_result</function> </para> </refsect1> + <refsect1> + <title>Example</title> + <para> + <example> + <title>Object oriented style</title> + <programlisting role='php'> +<![CDATA[ +<?php +$mysqli = new mysqli("localhost", "my_user", "my_password", "test"); + +$mysqli->query("DROP TABLE IF EXISTS friends"); +$mysqli->query("CREATE TABLE friends (id int, name varchar(20))"); + +$mysqli->query("INSERT INTO friends VALUES (1,'Hartmut'), (2, 'Ulf')"); + +$stmt = $mysqli->prepare("SELECT id, name FROM friends"); +$stmt->execute(); + +/* get resultset for metadata */ +$result = $stmt->get_metadata(); + +/* retrieve field information from metadata result set */ +$field = $result->fetch_field(); + +printf("Fieldname: %s\n", $field->name); + +/* close resultset */ +$result->close(); + +/* close connection */ +$mysqli->close(); +?> +]]> + </programlisting> + </example> + <example> + <title>Procedural style</title> + <programlisting role='php'> +<![CDATA[ +<?php +$link = mysqli_connect("localhost", "my_user", "my_password", "test"); + +mysqli_query($link, "DROP TABLE IF EXISTS friends"); +mysqli_query($link, "CREATE TABLE friends (id int, name varchar(20))"); + +mysqli_query($link, "INSERT INTO friends VALUES (1,'Hartmut'), (2, 'Ulf')"); + +$stmt = mysqli_prepare($link, "SELECT id, name FROM friends"); +mysqli_execute($stmt); + +/* get resultset for metadata */ +$result = mysqli_get_metadata($stmt); + +/* retrieve field information from metadata result set */ +$field = mysqli_fetch_field($result); + +printf("Fieldname: %s\n", $field->name); + +/* close resultset */ +mysqli_free_result($result); + +/* close connection */ +mysqli_close($link); +?> +]]> + </programlisting> + </example> + </para> + </refsect1> </refentry> <!-- Keep this comment at the end of the file http://cvs.php.net/diff.php/phpdoc/en/reference/mysqli/functions/mysqli-get-proto-info.xml?r1=1.4&r2=1.5&ty=u Index: phpdoc/en/reference/mysqli/functions/mysqli-get-proto-info.xml diff -u phpdoc/en/reference/mysqli/functions/mysqli-get-proto-info.xml:1.4 phpdoc/en/reference/mysqli/functions/mysqli-get-proto-info.xml:1.5 --- phpdoc/en/reference/mysqli/functions/mysqli-get-proto-info.xml:1.4 Wed Jan 28 18:18:42 2004 +++ phpdoc/en/reference/mysqli/functions/mysqli-get-proto-info.xml Sun Feb 22 16:46:41 2004 @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="iso-8859-1"?> -<!-- $Revision: 1.4 $ --> +<!-- $Revision: 1.5 $ --> <refentry id="function.mysqli-get-proto-info"> <refnamediv> <refname>mysqli_get_proto_info</refname> @@ -30,11 +30,48 @@ </para> </refsect1> <refsect1> - &reftitle.seealso; + <title>See also</title> <para> <function>mysqli_get_host_info</function> </para> </refsect1> + <refsect1> + <title>Example</title> + <para> + <example> + <title>Object oriented style</title> + <programlisting role='php'> +<![CDATA[ +<?php +$mysqli = new mysqli("localhost", "my_user", "my_password"); + +/* print host information */ +printf("Protocol version: %d\n", $mysqli->protocol_version); + +/* close connection */ +$mysqli->close(); +?> +]]> + </programlisting> + </example> + <example> + <title>Procedural style</title> + <programlisting role='php'> +<![CDATA[ +<?php +$link = mysqli_connect("localhost", "my_user", "my_password"); + +/* print host information */ +printf("Protocol version: %d\n", mysqli_get_proto_info($link)); + +/* close connection */ +mysqli_close($link); +?> +]]> + </programlisting> + </example> + </para> + </refsect1> </refentry> <!-- Keep this comment at the end of the file http://cvs.php.net/diff.php/phpdoc/en/reference/mysqli/functions/mysqli-report.xml?r1=1.2&r2=1.3&ty=u Index: phpdoc/en/reference/mysqli/functions/mysqli-report.xml diff -u phpdoc/en/reference/mysqli/functions/mysqli-report.xml:1.2 phpdoc/en/reference/mysqli/functions/mysqli-report.xml:1.3 --- phpdoc/en/reference/mysqli/functions/mysqli-report.xml:1.2 Fri Feb 20 09:45:50 2004 +++ phpdoc/en/reference/mysqli/functions/mysqli-report.xml Sun Feb 22 16:46:41 2004 @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="iso-8859-1"?> -<!-- $Revision: 1.2 $ --> +<!-- $Revision: 1.3 $ --> <refentry id="function.mysqli-report"> <refnamediv> <refname>mysqli_report</refname> @@ -88,6 +88,31 @@ ]]> </programlisting> </example> + <example> + <title>Object oriented style</title> + <programlisting role="php"> +<![CDATA[ +<?php +$link = mysqli_connect("localhost", "my_user", "my_password", "test"); + +mysqli_report(MYSQLI_REPORT_ALL); + +mysqli_query($link, "DROP TABLE IF EXISTS report"); +mysqli_query($link, "CREATE TABLE report (a int, b int, index(a))"); + +mysqli_query($link, "INSERT INTO report VALUES (1,1), (2,2), (1,3), (2,4), (6,5)"); + +/* this should report syntax error */ +mysqli_query($link, "UPDAE report SET a=a+1 WHERE b=3"); + +/* this should report index warning */ +mysqli_query($link, "UPDATE report SET a=a+1 WHERE b=3"); + +mysqli_close($link); +?> +]]> + </programlisting> + </example> </para> </refsect1> </refentry>
« previous php.doc (#969359152) next »