georg Thu Feb 26 02:18:17 2004 EDT
Modified files: /phpdoc/en/reference/mysqli/functions mysqli-info.xml mysqli-kill.xml Log: fixed bug in mysqli-info added kill sample http://cvs.php.net/diff.php/phpdoc/en/reference/mysqli/functions/mysqli-info.xml?r1=1.5&r2=1.6&ty=u Index: phpdoc/en/reference/mysqli/functions/mysqli-info.xml diff -u phpdoc/en/reference/mysqli/functions/mysqli-info.xml:1.5 phpdoc/en/reference/mysqli/functions/mysqli-info.xml:1.6 --- phpdoc/en/reference/mysqli/functions/mysqli-info.xml:1.5 Wed Feb 25 16:59:16 2004 +++ phpdoc/en/reference/mysqli/functions/mysqli-info.xml Thu Feb 26 02:18:17 2004 @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="iso-8859-1"?> -<!-- $Revision: 1.5 $ --> +<!-- $Revision: 1.6 $ --> <refentry id="function.mysqli-info"> <refnamediv> <refname>mysqli_info</refname> @@ -162,25 +162,3 @@ vim: et tw=78 syn=sgml vi: ts=1 sw=1 --> - </refentry> - -<!-- Keep this comment at the end of the file -Local variables: -mode: sgml -sgml-omittag:t -sgml-shorttag:t -sgml-minimize-attributes:nil -sgml-always-quote-attributes:t -sgml-indent-step:1 -sgml-indent-data:t -indent-tabs-mode:nil -sgml-parent-document:nil -sgml-default-dtd-file:"../../../../manual.ced" -sgml-exposed-tags:nil -sgml-local-catalogs:nil -sgml-local-ecat-files:nil -End: -vim600: syn=xml fen fdm=syntax fdl=2 si -vim: et tw=78 syn=sgml -vi: ts=1 sw=1 ---> http://cvs.php.net/diff.php/phpdoc/en/reference/mysqli/functions/mysqli-kill.xml?r1=1.5&r2=1.6&ty=u Index: phpdoc/en/reference/mysqli/functions/mysqli-kill.xml diff -u phpdoc/en/reference/mysqli/functions/mysqli-kill.xml:1.5 phpdoc/en/reference/mysqli/functions/mysqli-kill.xml:1.6 --- phpdoc/en/reference/mysqli/functions/mysqli-kill.xml:1.5 Wed Jan 28 18:18:42 2004 +++ phpdoc/en/reference/mysqli/functions/mysqli-kill.xml Thu Feb 26 02:18:17 2004 @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="iso-8859-1"?> -<!-- $Revision: 1.5 $ --> +<!-- $Revision: 1.6 $ --> <refentry id="function.mysqli-kill"> <refnamediv> <refname>mysqli_kill</refname> @@ -45,6 +45,79 @@ <function>mysqli_thread_id</function> </para> </refsect1> + <refsect1> + <title>Example</title> + <example> + <title>Object oriented style</title> + <programlisting role="php"> +<![CDATA[ +<?php +$mysqli = new mysqli("localhost", "my_user", "my_password", "world"); + +/* check connection */ +if (mysqli_connect_errno()) { + printf("Connect failed: %s\n", mysqli_connect_error()); + exit(); +} + +/* determine our thread id */ +$thread_id = $mysqli->thread_id; + +/* Kill connection */ +$mysqli->kill($thread_id); + +/* This should produce an error */ +if (!$mysqli->query("CREATE TABLE myCity LIKE City")) { + printf("Error: %s\n", $mysqli->error); + exit; +} + +/* close connection */ +$mysqli->close(); +?> +]]> + </programlisting> + </example> + <example> + <title>Procedural style</title> + <programlisting role="php"> +<![CDATA[ +<?php +$link = mysqli_connect("localhost", "my_user", "my_password", "world"); + +/* check connection */ +if (mysqli_connect_errno()) { + printf("Connect failed: %s\n", mysqli_connect_error()); + exit(); +} + +/* determine our thread id */ +$thread_id = mysqli_thread_id($link); + +/* Kill connection */ +mysqli_kill($link, $thread_id); + +/* This should produce an error */ +if (!mysqli_query($link, "CREATE TABLE myCity LIKE City")) { + printf("Error: %s\n", mysqli_error($link)); + exit; +} + +/* close connection */ +mysqli_close($link); +?> +]]> + </programlisting> + </example> + <para> + The above examples would produce the following output: + </para> + <screen> +<![CDATA[ +Error: MySQL server has gone away +]]> + </screen> + </refsect1> </refentry> <!-- Keep this comment at the end of the file @@ -67,3 +140,24 @@ vim: et tw=78 syn=sgml vi: ts=1 sw=1 --> + +<!-- Keep this comment at the end of the file +Local variables: +mode: sgml +sgml-omittag:t +sgml-shorttag:t +sgml-minimize-attributes:nil +sgml-always-quote-attributes:t +sgml-indent-step:1 +sgml-indent-data:t +indent-tabs-mode:nil +sgml-parent-document:nil +sgml-default-dtd-file:"../../../../manual.ced" +sgml-exposed-tags:nil +sgml-local-catalogs:nil +sgml-local-ecat-files:nil +End: +vim600: syn=xml fen fdm=syntax fdl=2 si +vim: et tw=78 syn=sgml +vi: ts=1 sw=1 +-->