[phpdoc-zh] r219 committed - 提交mysqli部分方法xml翻译

2 views
Skip to first unread message

phpd...@googlecode.com

unread,
Aug 14, 2011, 4:21:17 AM8/14/11
to phpd...@googlegroups.com
Revision: 219
Author: lgg860911
Date: Sun Aug 14 01:16:33 2011
Log: 提交mysqli部分方法xml翻译
http://code.google.com/p/phpdoc-zh/source/detail?r=219

Added:
/trunk/xml/reference/mysqli/mysqli
/trunk/xml/reference/mysqli/mysqli/affected-rows.xml
/trunk/xml/reference/mysqli/mysqli/autocommit.xml
/trunk/xml/reference/mysqli/mysqli/change-user.xml
/trunk/xml/reference/mysqli/mysqli/character-set-name.xml
/trunk/xml/reference/mysqli/mysqli/client-info.xml
/trunk/xml/reference/mysqli/mysqli/client-version.xml
/trunk/xml/reference/mysqli/mysqli/close.xml
/trunk/xml/reference/mysqli/mysqli/commit.xml
/trunk/xml/reference/mysqli/mysqli/connect-errno.xml
/trunk/xml/reference/mysqli/mysqli/connect-error.xml
/trunk/xml/reference/mysqli/mysqli/connect.xml
/trunk/xml/reference/mysqli/mysqli/debug.xml
/trunk/xml/reference/mysqli/mysqli/dump-debug-info.xml
/trunk/xml/reference/mysqli/mysqli/errno.xml
/trunk/xml/reference/mysqli/mysqli/error.xml
/trunk/xml/reference/mysqli/mysqli/field-count.xml
/trunk/xml/reference/mysqli/mysqli/get-charset.xml
/trunk/xml/reference/mysqli/mysqli/get-client-info.xml
/trunk/xml/reference/mysqli/mysqli/get-client-stats.xml
/trunk/xml/reference/mysqli/mysqli/get-client-version.xml
/trunk/xml/reference/mysqli/mysqli/get-connection-stats.xml
/trunk/xml/reference/mysqli/mysqli/get-host-info.xml
/trunk/xml/reference/mysqli/mysqli/get-proto-info.xml
/trunk/xml/reference/mysqli/mysqli/get-server-info.xml
/trunk/xml/reference/mysqli/mysqli/get-server-version.xml
/trunk/xml/reference/mysqli/mysqli/get-warnings.xml
/trunk/xml/reference/mysqli/mysqli/info.xml
/trunk/xml/reference/mysqli/mysqli/init.xml
/trunk/xml/reference/mysqli/mysqli/insert-id.xml
/trunk/xml/reference/mysqli/mysqli/kill.xml
/trunk/xml/reference/mysqli/mysqli/more-results.xml
/trunk/xml/reference/mysqli/mysqli/multi-query.xml
/trunk/xml/reference/mysqli/mysqli/next-result.xml
/trunk/xml/reference/mysqli/mysqli/options.xml
/trunk/xml/reference/mysqli/mysqli/ping.xml
/trunk/xml/reference/mysqli/mysqli/poll.xml
/trunk/xml/reference/mysqli/mysqli/prepare.xml
/trunk/xml/reference/mysqli/mysqli/query.xml
/trunk/xml/reference/mysqli/mysqli/real-connect.xml
/trunk/xml/reference/mysqli/mysqli/real-escape-string.xml
/trunk/xml/reference/mysqli/mysqli/real-query.xml
/trunk/xml/reference/mysqli/mysqli/reap-async-query.xml
/trunk/xml/reference/mysqli/mysqli/rollback.xml
/trunk/xml/reference/mysqli/mysqli/select-db.xml
/trunk/xml/reference/mysqli/mysqli/set-charset.xml
/trunk/xml/reference/mysqli/mysqli/set-local-infile-default.xml
/trunk/xml/reference/mysqli/mysqli/set-local-infile-handler.xml
/trunk/xml/reference/mysqli/mysqli/sqlstate.xml
/trunk/xml/reference/mysqli/mysqli/ssl-set.xml
/trunk/xml/reference/mysqli/mysqli/stat.xml
/trunk/xml/reference/mysqli/mysqli/stmt-init.xml
/trunk/xml/reference/mysqli/mysqli/store-result.xml
/trunk/xml/reference/mysqli/mysqli/thread-id.xml
/trunk/xml/reference/mysqli/mysqli/thread-safe.xml
/trunk/xml/reference/mysqli/mysqli/use-result.xml
/trunk/xml/reference/mysqli/mysqli/warning-count.xml

=======================================
--- /dev/null
+++ /trunk/xml/reference/mysqli/mysqli/affected-rows.xml Sun Aug 14
01:16:33 2011
@@ -0,0 +1,186 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!-- $Revision: 299196 $ -->
+<refentry xml:id="mysqli.affected-rows"
xmlns="http://docbook.org/ns/docbook">
+ <refnamediv>
+ <refname>mysqli->affected_rows</refname>
+ <refname>mysqli_affected_rows</refname>
+ <refpurpose>Gets the number of affected rows in a previous MySQL
operation</refpurpose>
+ </refnamediv>
+
+ <refsect1 role="description">
+ &reftitle.description;
+ <para>&style.oop;</para>
+ <classsynopsis>
+ <ooclass><classname>mysqli</classname></ooclass>
+
<fieldsynopsis><type>int</type><varname>affected_rows</varname></fieldsynopsis>
+ </classsynopsis>
+ <para>&style.procedural;</para>
+ <methodsynopsis>
+ <type>int</type><methodname>mysqli_affected_rows</methodname>
+
<methodparam><type>mysqli</type><parameter>link</parameter></methodparam>
+ </methodsynopsis>
+ <para>
+ Returns the number of rows affected by the last
<literal>INSERT</literal>,
+ <literal>UPDATE</literal>, <literal>REPLACE</literal> or
+ <literal>DELETE</literal> query.
+ </para>
+ <para>
+ For SELECT statements <function>mysqli_affected_rows</function> works
like
+ <function>mysqli_num_rows</function>.
+ </para>
+ </refsect1>
+
+ <refsect1 role="parameters">
+ &reftitle.parameters;
+ <para>
+ <variablelist>
+ &mysqli.link.description;
+ </variablelist>
+ </para>
+ </refsect1>
+
+ <refsect1 role="returnvalues">
+ &reftitle.returnvalues;
+ <para>
+ An integer greater than zero indicates the number of rows affected or
+ retrieved.
+ Zero indicates that no records where updated for an UPDATE statement, no
+ rows matched the <literal>WHERE</literal> clause in the query or that no
+ query has yet been executed. -1 indicates that the query returned an
+ error.
+ </para>
+ <note>
+ <para>
+ If the number of affected rows is greater than maximal int value, the
+ number of affected rows will be returned as a string.
+ </para>
+ </note>
+ </refsect1>
+
+ <refsect1 role="examples">
+ &reftitle.examples;
+ <example>
+ <title><varname>mysqli->affected_rows</varname> example</title>
+ <para>&style.oop;</para>
+ <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();
+}
+
+/* Insert rows */
+$mysqli->query("CREATE TABLE Language SELECT * from CountryLanguage");
+printf("Affected rows (INSERT): %d\n", $mysqli->affected_rows);
+
+$mysqli->query("ALTER TABLE Language ADD Status int default 0");
+
+/* update rows */
+$mysqli->query("UPDATE Language SET Status=1 WHERE Percentage > 50");
+printf("Affected rows (UPDATE): %d\n", $mysqli->affected_rows);
+
+/* delete rows */
+$mysqli->query("DELETE FROM Language WHERE Percentage < 50");
+printf("Affected rows (DELETE): %d\n", $mysqli->affected_rows);
+
+/* select all rows */
+$result = $mysqli->query("SELECT CountryCode FROM Language");
+printf("Affected rows (SELECT): %d\n", $mysqli->affected_rows);
+
+$result->close();
+
+/* Delete table Language */
+$mysqli->query("DROP TABLE Language");
+
+/* close connection */
+$mysqli->close();
+?>
+]]>
+ </programlisting>
+ <para>&style.procedural;</para>
+ <programlisting role="php">
+<![CDATA[
+<?php
+$link = mysqli_connect("localhost", "my_user", "my_password", "world");
+
+if (!$link) {
+ printf("Can't connect to localhost. Error: %s\n",
mysqli_connect_error());
+ exit();
+}
+
+/* Insert rows */
+mysqli_query($link, "CREATE TABLE Language SELECT * from CountryLanguage");
+printf("Affected rows (INSERT): %d\n", mysqli_affected_rows($link));
+
+mysqli_query($link, "ALTER TABLE Language ADD Status int default 0");
+
+/* update rows */
+mysqli_query($link, "UPDATE Language SET Status=1 WHERE Percentage > 50");
+printf("Affected rows (UPDATE): %d\n", mysqli_affected_rows($link));
+
+/* delete rows */
+mysqli_query($link, "DELETE FROM Language WHERE Percentage < 50");
+printf("Affected rows (DELETE): %d\n", mysqli_affected_rows($link));
+
+/* select all rows */
+$result = mysqli_query($link, "SELECT CountryCode FROM Language");
+printf("Affected rows (SELECT): %d\n", mysqli_affected_rows($link));
+
+mysqli_free_result($result);
+
+/* Delete table Language */
+mysqli_query($link, "DROP TABLE Language");
+
+/* close connection */
+mysqli_close($link);
+?>
+]]>
+ </programlisting>
+ &examples.outputs;
+ <screen>
+<![CDATA[
+Affected rows (INSERT): 984
+Affected rows (UPDATE): 168
+Affected rows (DELETE): 815
+Affected rows (SELECT): 169
+]]>
+ </screen>
+ </example>
+ </refsect1>
+
+ <refsect1 role="seealso">
+ &reftitle.seealso;
+ <para>
+ <simplelist>
+ <member><function>mysqli_num_rows</function></member>
+ <member><function>mysqli_info</function></member>
+ </simplelist>
+ </para>
+ </refsect1>
+
+</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:"~/.phpdoc/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
+-->
=======================================
--- /dev/null
+++ /trunk/xml/reference/mysqli/mysqli/autocommit.xml Sun Aug 14 01:16:33
2011
@@ -0,0 +1,160 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!-- $Revision: 299196 $ -->
+<refentry xml:id="mysqli.autocommit" xmlns="http://docbook.org/ns/docbook">
+ <refnamediv>
+ <refname>mysqli::autocommit</refname>
+ <refname>mysqli_autocommit</refname>
+ <refpurpose>Turns on or off auto-commiting database
modifications</refpurpose>
+ </refnamediv>
+
+ <refsect1 role="description">
+ &reftitle.description;
+ <para>&style.oop;</para>
+ <methodsynopsis>
+ <type>bool</type><methodname>mysqli::autocommit</methodname>
+ <methodparam><type>bool</type><parameter>mode</parameter></methodparam>
+ </methodsynopsis>
+ <para>&style.procedural;</para>
+ <methodsynopsis>
+ <type>bool</type><methodname>mysqli_autocommit</methodname>
+
<methodparam><type>mysqli</type><parameter>link</parameter></methodparam>
+ <methodparam><type>bool</type><parameter>mode</parameter></methodparam>
+ </methodsynopsis>
+ <para>
+ Turns on or off auto-commit mode on queries for the database connection.
+ </para>
+ <para>
+ To determine the current state of autocommit use the SQL command
+ <literal>SELECT @@autocommit</literal>.
+ </para>
+ </refsect1>
+
+ <refsect1 role="parameters">
+ &reftitle.parameters;
+ <para>
+ <variablelist>
+ &mysqli.link.description;
+ <varlistentry>
+ <term><parameter>mode</parameter></term>
+ <listitem>
+ <para>
+ Whether to turn on auto-commit or not.
+ </para>
+ </listitem>
+ </varlistentry>
+ </variablelist>
+ </para>
+ </refsect1>
+
+ <refsect1 role="returnvalues">
+ &reftitle.returnvalues;
+ <para>
+ &return.success;
+ </para>
+ </refsect1>
+
+ <refsect1 role="notes">
+ &reftitle.notes;
+ <note>
+ <para>
+ This function doesn't work with non transactional table types (like
+ MyISAM or ISAM).
+ </para>
+ </note>
+ </refsect1>
+
+ <refsect1 role="examples">
+ &reftitle.examples;
+ <example>
+ <title><methodname>mysqli::autocommit</methodname> example</title>
+ <para>&style.oop;</para>
+ <programlisting role="php">
+<![CDATA[
+<?php
+$mysqli = new mysqli("localhost", "my_user", "my_password", "world");
+
+if (mysqli_connect_errno()) {
+ printf("Connect failed: %s\n", mysqli_connect_error());
+ exit();
+}
+
+/* turn autocommit on */
+$mysqli->autocommit(TRUE);
+
+if ($result = $mysqli->query("SELECT @@autocommit")) {
+ $row = $result->fetch_row();
+ printf("Autocommit is %s\n", $row[0]);
+ $result->free();
+}
+
+/* close connection */
+$mysqli->close();
+?>
+]]>
+ </programlisting>
+ <para>&style.procedural;</para>
+ <programlisting role="php">
+<![CDATA[
+<?php
+$link = mysqli_connect("localhost", "my_user", "my_password", "world");
+
+if (!$link) {
+ printf("Can't connect to localhost. Error: %s\n",
mysqli_connect_error());
+ exit();
+}
+
+/* turn autocommit on */
+mysqli_autocommit($link, TRUE);
+
+if ($result = mysqli_query($link, "SELECT @@autocommit")) {
+ $row = mysqli_fetch_row($result);
+ printf("Autocommit is %s\n", $row[0]);
+ mysqli_free_result($result);
+}
+
+/* close connection */
+mysqli_close($link);
+?>
+]]>
+ </programlisting>
+ &examples.outputs;
+ <screen>
+<![CDATA[
+Autocommit is 1
+]]>
+ </screen>
+ </example>
+ </refsect1>
+
+ <refsect1 role="seealso">
+ &reftitle.seealso;
+ <para>
+ <simplelist>
+ <member><function>mysqli_commit</function></member>
+ <member><function>mysqli_rollback</function></member>
+ </simplelist>
+ </para>
+ </refsect1>
+
+</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:"~/.phpdoc/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
+-->
=======================================
--- /dev/null
+++ /trunk/xml/reference/mysqli/mysqli/change-user.xml Sun Aug 14 01:16:33
2011
@@ -0,0 +1,219 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!-- $Revision: 299196 $ -->
+<refentry xml:id="mysqli.change-user"
xmlns="http://docbook.org/ns/docbook">
+ <refnamediv>
+ <refname>mysqli::change_user</refname>
+ <refname>mysqli_change_user</refname>
+ <refpurpose>Changes the user of the specified database
connection</refpurpose>
+ </refnamediv>
+
+ <refsect1 role="description">
+ &reftitle.description;
+ <para>&style.oop;</para>
+ <methodsynopsis>
+ <type>bool</type><methodname>mysqli::change_user</methodname>
+
<methodparam><type>string</type><parameter>user</parameter></methodparam>
+
<methodparam><type>string</type><parameter>password</parameter></methodparam>
+
<methodparam><type>string</type><parameter>database</parameter></methodparam>
+ </methodsynopsis>
+ <para>&style.procedural;</para>
+ <methodsynopsis>
+ <type>bool</type><methodname>mysqli_change_user</methodname>
+
<methodparam><type>mysqli</type><parameter>link</parameter></methodparam>
+
<methodparam><type>string</type><parameter>user</parameter></methodparam>
+
<methodparam><type>string</type><parameter>password</parameter></methodparam>
+
<methodparam><type>string</type><parameter>database</parameter></methodparam>
+ </methodsynopsis>
+ <para>
+ Changes the user of the specified database connection and sets the
current
+ database.
+ </para>
+ <para>
+ In order to successfully change users a valid
<parameter>username</parameter> and
+ <parameter>password</parameter> parameters must be provided and that
user must have
+ sufficient permissions to access the desired database. If for any
reason authorization
+ fails, the current user authentication will remain.
+ </para>
+ </refsect1>
+
+ <refsect1 role="parameters">
+ &reftitle.parameters;
+ <para>
+ <variablelist>
+ &mysqli.link.description;
+ <varlistentry>
+ <term><parameter>user</parameter></term>
+ <listitem>
+ <para>
+ The MySQL user name.
+ </para>
+ </listitem>
+ </varlistentry>
+ <varlistentry>
+ <term><parameter>password</parameter></term>
+ <listitem>
+ <para>
+ The MySQL password.
+ </para>
+ </listitem>
+ </varlistentry>
+ <varlistentry>
+ <term><parameter>database</parameter></term>
+ <listitem>
+ <para>
+ The database to change to.
+ </para>
+ <para>
+ If desired, the &null; value may be passed resulting in only
changing
+ the user and not selecting a database. To select a database in this
+ case use the <function>mysqli_select_db</function> function.
+ </para>
+ </listitem>
+ </varlistentry>
+ </variablelist>
+ </para>
+ </refsect1>
+
+ <refsect1 role="returnvalues">
+ &reftitle.returnvalues;
+ <para>
+ &return.success;
+ </para>
+ </refsect1>
+
+ <refsect1 role="notes">
+ &reftitle.notes;
+ <note>
+ <para>
+ Using this command will always cause the current database connection to
+ behave as if was a completely new database connection, regardless of if
+ the operation was completed successfully. This reset includes
performing
+ a rollback on any active transactions, closing all temporary tables,
and
+ unlocking all locked tables.
+ </para>
+ </note>
+ </refsect1>
+
+ <refsect1 role="examples">
+ &reftitle.examples;
+ <example>
+ <title><methodname>mysqli::change_user</methodname> example</title>
+ <para>&style.oop;</para>
+ <programlisting role="php">
+<![CDATA[
+<?php
+
+/* connect database test */
+$mysqli = new mysqli("localhost", "my_user", "my_password", "test");
+
+/* check connection */
+if (mysqli_connect_errno()) {
+ printf("Connect failed: %s\n", mysqli_connect_error());
+ exit();
+}
+
+/* Set Variable a */
+$mysqli->query("SET @a:=1");
+
+/* reset all and select a new database */
+$mysqli->change_user("my_user", "my_password", "world");
+
+if ($result = $mysqli->query("SELECT DATABASE()")) {
+ $row = $result->fetch_row();
+ printf("Default database: %s\n", $row[0]);
+ $result->close();
+}
+
+if ($result = $mysqli->query("SELECT @a")) {
+ $row = $result->fetch_row();
+ if ($row[0] === NULL) {
+ printf("Value of variable a is NULL\n");
+ }
+ $result->close();
+}
+
+/* close connection */
+$mysqli->close();
+?>
+]]>
+ </programlisting>
+ <para>&style.procedural;</para>
+ <programlisting role="php">
+<![CDATA[
+<?php
+/* connect database test */
+$link = mysqli_connect("localhost", "my_user", "my_password", "test");
+
+/* check connection */
+if (!$link) {
+ printf("Connect failed: %s\n", mysqli_connect_error());
+ exit();
+}
+
+/* Set Variable a */
+mysqli_query($link, "SET @a:=1");
+
+/* reset all and select a new database */
+mysqli_change_user($link, "my_user", "my_password", "world");
+
+if ($result = mysqli_query($link, "SELECT DATABASE()")) {
+ $row = mysqli_fetch_row($result);
+ printf("Default database: %s\n", $row[0]);
+ mysqli_free_result($result);
+}
+
+if ($result = mysqli_query($link, "SELECT @a")) {
+ $row = mysqli_fetch_row($result);
+ if ($row[0] === NULL) {
+ printf("Value of variable a is NULL\n");
+ }
+ mysqli_free_result($result);
+}
+
+/* close connection */
+mysqli_close($link);
+?>
+]]>
+ </programlisting>
+ &examples.outputs;
+ <screen>
+<![CDATA[
+Default database: world
+Value of variable a is NULL
+]]>
+ </screen>
+ </example>
+ </refsect1>
+
+ <refsect1 role="seealso">
+ &reftitle.seealso;
+ <para>
+ <simplelist>
+ <member><function>mysqli_connect</function></member>
+ <member><function>mysqli_select_db</function></member>
+ </simplelist>
+ </para>
+ </refsect1>
+
+</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:"~/.phpdoc/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
+-->
=======================================
--- /dev/null
+++ /trunk/xml/reference/mysqli/mysqli/character-set-name.xml Sun Aug 14
01:16:33 2011
@@ -0,0 +1,128 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!-- $Revision: 299196 $ -->
+<refentry xml:id="mysqli.character-set-name"
xmlns="http://docbook.org/ns/docbook">
+ <refnamediv>
+ <refname>mysqli::character_set_name</refname>
+ <refname>mysqli_character_set_name</refname>
+ <refpurpose>Returns the default character set for the database
connection</refpurpose>
+ </refnamediv>
+
+ <refsect1 role="description">
+ &reftitle.description;
+ <para>&style.oop;</para>
+ <methodsynopsis>
+ <type>string</type><methodname>mysqli::character_set_name</methodname>
+ <void />
+ </methodsynopsis>
+ <para>&style.procedural;</para>
+ <methodsynopsis>
+ <type>string</type><methodname>mysqli_character_set_name</methodname>
+
<methodparam><type>mysqli</type><parameter>link</parameter></methodparam>
+ </methodsynopsis>
+ <para>
+ Returns the current character set for the database connection.
+ </para>
+ </refsect1>
+
+ <refsect1 role="parameters">
+ &reftitle.parameters;
+ <para>
+ <variablelist>
+ &mysqli.link.description;
+ </variablelist>
+ </para>
+ </refsect1>
+
+ <refsect1 role="returnvalues">
+ &reftitle.returnvalues;
+ <para>The default character set for the current connection</para>
+ </refsect1>
+
+ <refsect1 role="examples">
+ &reftitle.examples;
+ <example>
+ <title><methodname>mysqli::character_set_name</methodname>
example</title>
+ <para>&style.oop;</para>
+ <programlisting role="php">
+<![CDATA[
+<?php
+/* Open a connection */
+$mysqli = new mysqli("localhost", "my_user", "my_password", "world");
+
+/* check connection */
+if (mysqli_connect_errno()) {
+ printf("Connect failed: %s\n", mysqli_connect_error());
+ exit();
+}
+
+/* Print current character set */
+$charset = $mysqli->character_set_name();
+printf ("Current character set is %s\n", $charset);
+
+$mysqli->close();
+?>
+]]>
+ </programlisting>
+ <para>&style.procedural;</para>
+ <programlisting role="php">
+<![CDATA[
+<?php
+/* Open a connection */
+$link = mysqli_connect("localhost", "my_user", "my_password", "world");
+
+/* check connection */
+if (!$link) {
+ printf("Connect failed: %s\n", mysqli_connect_error());
+ exit();
+}
+
+/* Print current character set */
+$charset = mysqli_character_set_name($link);
+printf ("Current character set is %s\n",$charset);
+
+/* close connection */
+mysqli_close($link);
+?>
+]]>
+ </programlisting>
+ &examples.outputs;
+ <screen>
+<![CDATA[
+Current character set is latin1_swedish_ci
+]]>
+ </screen>
+ </example>
+ </refsect1>
+
+ <refsect1 role="seealso">
+ &reftitle.seealso;
+ <para>
+ <simplelist>
+ <member><function>mysqli_client_encoding</function></member>
+ <member><function>mysqli_real_escape_string</function></member>
+ </simplelist>
+ </para>
+ </refsect1>
+
+</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:"~/.phpdoc/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
+-->
=======================================
--- /dev/null
+++ /trunk/xml/reference/mysqli/mysqli/client-info.xml Sun Aug 14 01:16:33
2011
@@ -0,0 +1,86 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!-- $Revision: 299158 $ -->
+<refentry xml:id="mysqli.client-info"
xmlns="http://docbook.org/ns/docbook">
+ <refnamediv>
+ <refname>mysqli->client_info</refname>
+ <refname>mysqli_get_client_info</refname>
+ <refpurpose>Returns the MySQL client version as a string</refpurpose>
+ </refnamediv>
+
+ <refsect1 role="description">
+ &reftitle.description;
+ <para>&style.oop;</para>
+ <classsynopsis>
+ <ooclass><classname>mysqli</classname></ooclass>
+
<fieldsynopsis><type>string</type><varname>client_info</varname></fieldsynopsis>
+ </classsynopsis>
+ <para>&style.procedural;</para>
+ <methodsynopsis>
+ <type>string</type><methodname>mysqli_get_client_info</methodname>
+
<methodparam><type>mysqli</type><parameter>link</parameter></methodparam>
+ </methodsynopsis>
+ <para>
+ Returns a string that represents the MySQL client library version.
+ </para>
+ </refsect1>
+
+ <refsect1 role="returnvalues">
+ &reftitle.returnvalues;
+ <para>
+ A string that represents the MySQL client library version
+ </para>
+ </refsect1>
+
+ <refsect1 role="examples">
+ &reftitle.examples;
+ <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>
+
+ <refsect1 role="seealso">
+ &reftitle.seealso;
+ <para>
+ <simplelist>
+ <member><function>mysqli_get_client_version</function></member>
+ <member><function>mysqli_get_server_info</function></member>
+ <member><function>mysqli_get_server_version</function></member>
+ </simplelist>
+ </para>
+ </refsect1>
+
+</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:"~/.phpdoc/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
+-->
=======================================
--- /dev/null
+++ /trunk/xml/reference/mysqli/mysqli/client-version.xml Sun Aug 14
01:16:33 2011
@@ -0,0 +1,92 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!-- $Revision: 299158 $ -->
+<refentry xml:id="mysqli.client-version"
xmlns="http://docbook.org/ns/docbook">
+ <refnamediv>
+ <refname>mysqli->client_version</refname>
+ <refname>mysqli_get_client_version</refname>
+ <refpurpose>Get MySQL client info</refpurpose>
+ </refnamediv>
+
+ <refsect1 role="description">
+ &reftitle.description;
+ <para>&style.oop;</para>
+ <classsynopsis>
+ <ooclass><classname>mysqli</classname></ooclass>
+
<fieldsynopsis><type>int</type><varname>client_version</varname></fieldsynopsis>
+ </classsynopsis>
+ <para>&style.procedural;</para>
+ <methodsynopsis>
+ <type>int</type><methodname>mysqli_get_client_version</methodname>
+
<methodparam><type>mysqli</type><parameter>link</parameter></methodparam>
+ </methodsynopsis>
+ <para>
+ Returns client version number as an integer.
+ </para>
+ </refsect1>
+
+ <refsect1 role="returnvalues">
+ &reftitle.returnvalues;
+ <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 role="examples">
+ &reftitle.examples;
+ <para>
+ <example>
+ <title>mysqli_get_client_version</title>
+ <programlisting role='php'>
+<![CDATA[
+<?php
+
+/* 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>
+
+ <refsect1 role="seealso">
+ &reftitle.seealso;
+ <para>
+ <simplelist>
+ <member><function>mysqli_get_client_info</function></member>
+ <member><function>mysqli_get_server_info</function></member>
+ <member><function>mysqli_get_server_version</function></member>
+ </simplelist>
+ </para>
+ </refsect1>
+
+</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:"~/.phpdoc/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
+-->
=======================================
--- /dev/null
+++ /trunk/xml/reference/mysqli/mysqli/close.xml Sun Aug 14 01:16:33 2011
@@ -0,0 +1,82 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!-- $Revision: 299158 $ -->
+<refentry xml:id="mysqli.close" xmlns="http://docbook.org/ns/docbook">
+ <refnamediv>
+ <refname>mysqli::close</refname>
+ <refname>mysqli_close</refname>
+ <refpurpose>Closes a previously opened database connection</refpurpose>
+ </refnamediv>
+
+ <refsect1 role="description">
+ &reftitle.description;
+ <para>&style.oop;</para>
+ <methodsynopsis>
+ <type>bool</type><methodname>mysqli::close</methodname>
+ <void />
+ </methodsynopsis>
+ <para>&style.procedural;</para>
+ <methodsynopsis>
+ <type>bool</type><methodname>mysqli_close</methodname>
+
<methodparam><type>mysqli</type><parameter>link</parameter></methodparam>
+ </methodsynopsis>
+ <para>
+ Closes a previously opened database connection.
+ </para>
+ </refsect1>
+
+ <refsect1 role="parameters">
+ &reftitle.parameters;
+ <para>
+ <variablelist>
+ &mysqli.link.description;
+ </variablelist>
+ </para>
+ </refsect1>
+
+ <refsect1 role="returnvalues">
+ &reftitle.returnvalues;
+ <para>
+ &return.success;
+ </para>
+ </refsect1>
+
+ <refsect1 role="examples">
+ &reftitle.examples;
+ <para>
+ See <function>mysqli_connect</function>.
+ </para>
+ </refsect1>
+
+ <refsect1 role="seealso">
+ &reftitle.seealso;
+ <para>
+ <simplelist>
+ <member><function>mysqli_connect</function></member>
+ <member><function>mysqli_init</function></member>
+ <member><function>mysqli_real_connect</function></member>
+ </simplelist>
+ </para>
+ </refsect1>
+
+</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:"~/.phpdoc/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
+-->
=======================================
--- /dev/null
+++ /trunk/xml/reference/mysqli/mysqli/commit.xml Sun Aug 14 01:16:33 2011
@@ -0,0 +1,142 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!-- $Revision: 299196 $ -->
+<refentry xml:id="mysqli.commit" xmlns="http://docbook.org/ns/docbook">
+ <refnamediv>
+ <refname>mysqli::commit</refname>
+ <refname>mysqli_commit</refname>
+ <refpurpose>提交一个事务</refpurpose>
+ </refnamediv>
+
+ <refsect1 role="description">
+ &reftitle.description;
+ <para>&style.oop;</para>
+ <methodsynopsis>
+ <type>bool</type><methodname>mysqli::commit</methodname>
+ <void />
+ </methodsynopsis>
+ <para>&style.procedural;</para>
+ <methodsynopsis>
+ <type>bool</type><methodname>mysqli_commit</methodname>
+
<methodparam><type>mysqli</type><parameter>link</parameter></methodparam>
+ </methodsynopsis>
+ <para>
+ 提交数据库连接的当前事务
+ </para>
+ </refsect1>
+
+ <refsect1 role="parameters">
+ &reftitle.parameters;
+ <para>
+ <variablelist>
+ &mysqli.link.description;
+ </variablelist>
+ </para>
+ </refsect1>
+
+ <refsect1 role="returnvalues">
+ &reftitle.returnvalues;
+ <para>
+ &return.success;
+ </para>
+ </refsect1>
+
+ <refsect1 role="examples">
+ &reftitle.examples;
+ <example>
+ <title><methodname>mysqli::commit</methodname> example</title>
+ <para>&style.oop;</para>
+ <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();
+}
+
+$mysqli->query("CREATE TABLE Language LIKE CountryLanguage");
+
+/* set autocommit to off */
+$mysqli->autocommit(FALSE);
+
+/* Insert some values */
+$mysqli->query("INSERT INTO Language VALUES ('DEU', 'Bavarian', 'F',
11.2)");
+$mysqli->query("INSERT INTO Language VALUES ('DEU', 'Swabian', 'F', 9.4)");
+
+/* commit transaction */
+$mysqli->commit();
+
+/* drop table */
+$mysqli->query("DROP TABLE Language");
+
+/* close connection */
+$mysqli->close();
+?>
+]]>
+ </programlisting>
+ <para>&style.procedural;</para>
+ <programlisting role="php">
+<![CDATA[
+<?php
+$link = mysqli_connect("localhost", "my_user", "my_password", "test");
+
+/* check connection */
+if (!$link) {
+ printf("Connect failed: %s\n", mysqli_connect_error());
+ exit();
+}
+
+/* set autocommit to off */
+mysqli_autocommit($link, FALSE);
+
+mysqli_query($link, "CREATE TABLE Language LIKE CountryLanguage");
+
+/* Insert some values */
+mysqli_query($link, "INSERT INTO Language VALUES ('DEU', 'Bavarian', 'F',
11.2)");
+mysqli_query($link, "INSERT INTO Language VALUES ('DEU', 'Swabian', 'F',
9.4)");
+
+/* commit transaction */
+mysqli_commit($link);
+
+/* close connection */
+mysqli_close($link);
+?>
+]]>
+ </programlisting>
+ </example>
+ </refsect1>
+
+ <refsect1 role="seealso">
+ &reftitle.seealso;
+ <para>
+ <simplelist>
+ <member><function>mysqli_autocommit</function></member>
+ <member><function>mysqli_rollback</function></member>
+ </simplelist>
+ </para>
+ </refsect1>
+
+</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:"~/.phpdoc/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
+-->
=======================================
--- /dev/null
+++ /trunk/xml/reference/mysqli/mysqli/connect-errno.xml Sun Aug 14
01:16:33 2011
@@ -0,0 +1,116 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!-- $Revision: 299196 $ -->
+<refentry xml:id="mysqli.connect-errno"
xmlns="http://docbook.org/ns/docbook">
+ <refnamediv>
+ <refname>mysqli->connect_errno</refname>
+ <refname>mysqli_connect_errno</refname>
+ <refpurpose>Returns the error code from last connect call</refpurpose>
+ </refnamediv>
+
+ <refsect1 role="description">
+ &reftitle.description;
+ <para>&style.oop;</para>
+ <classsynopsis>
+ <ooclass><classname>mysqli</classname></ooclass>
+
<fieldsynopsis><type>string</type><varname>connect_errno</varname></fieldsynopsis>
+ </classsynopsis>
+ <para>&style.procedural;</para>
+ <methodsynopsis>
+ <type>int</type><methodname>mysqli_connect_errno</methodname>
+ <void />
+ </methodsynopsis>
+ <para>
+ Returns the last error code number from the last call to
+ <function>mysqli_connect</function>.
+ </para>
+ <note>
+ <para>
+ Client error message numbers are listed in the MySQL
+ <filename>errmsg.h</filename> header file, server error message numbers
+ are listed in <filename>mysqld_error.h</filename>. In the MySQL source
+ distribution you can find a complete list of error messages and error
+ numbers in the file <filename>Docs/mysqld_error.txt</filename>.
+ </para>
+ </note>
+ </refsect1>
+
+ <refsect1 role="returnvalues">
+ &reftitle.returnvalues;
+ <para>
+ An error code value for the last call to
<function>mysqli_connect</function>, if it failed.
+ zero means no error occurred.
+ </para>
+ </refsect1>
+
+ <refsect1 role="examples">
+ &reftitle.examples;
+ <example>
+ <title><varname>mysqli->connect_errno</varname> example</title>
+ <para>&style.oop;</para>
+ <programlisting role="php">
+<![CDATA[
+<?php
+$mysqli = @new mysqli('localhost', 'fake_user', 'my_password', 'my_db');
+
+if ($mysqli->connect_errno) {
+ die('Connect Error: ' . $mysqli->connect_errno);
+}
+?>
+]]>
+ </programlisting>
+ <para>&style.procedural;</para>
+ <programlisting role="php">
+<![CDATA[
+<?php
+$link = @mysqli_connect('localhost', 'fake_user', 'my_password', 'my_db');
+
+if (!$link) {
+ die('Connect Error: ' . mysqli_connect_errno());
+}
+?>
+]]>
+ </programlisting>
+ &examples.outputs;
+ <screen>
+<![CDATA[
+Connect Error: 1045
+]]>
+ </screen>
+ </example>
+ </refsect1>
+
+ <refsect1 role="seealso">
+ &reftitle.seealso;
+ <para>
+ <simplelist>
+ <member><function>mysqli_connect</function></member>
+ <member><function>mysqli_connect_error</function></member>
+ <member><function>mysqli_errno</function></member>
+ <member><function>mysqli_error</function></member>
+ <member><function>mysqli_sqlstate</function></member>
+ </simplelist>
+ </para>
+ </refsect1>
+
+</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:"~/.phpdoc/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
+-->
=======================================
--- /dev/null
+++ /trunk/xml/reference/mysqli/mysqli/connect-error.xml Sun Aug 14
01:16:33 2011
@@ -0,0 +1,119 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!-- $Revision: 299196 $ -->
+<refentry xml:id="mysqli.connect-error"
xmlns="http://docbook.org/ns/docbook">
+ <refnamediv>
+ <refname>mysqli->connect_error</refname>
+ <refname>mysqli_connect_error</refname>
+ <refpurpose>Returns a string description of the last connect
error</refpurpose>
+ </refnamediv>
+
+ <refsect1 role="description">
+ &reftitle.description;
+ <para>&style.oop;</para>
+ <classsynopsis>
+ <ooclass><classname>mysqli</classname></ooclass>
+
<fieldsynopsis><type>string</type><varname>connect_error</varname></fieldsynopsis>
+ </classsynopsis>
+ <para>&style.procedural;</para>
+ <methodsynopsis>
+ <type>string</type><methodname>mysqli_connect_error</methodname>
+ <void />
+ </methodsynopsis>
+ <para>
+ Returns the last error message string from the last call to
+ <function>mysqli_connect</function>.
+ </para>
+ </refsect1>
+
+ <refsect1 role="returnvalues">
+ &reftitle.returnvalues;
+ <para>
+ A string that describes the error. &null; is returned if no error
occurred.
+ </para>
+ </refsect1>
+
+ <refsect1 role="examples">
+ &reftitle.examples;
+ <example>
+ <title><varname>mysqli->connect_error</varname> example</title>
+ <para>&style.oop;</para>
+ <programlisting role="php">
+<![CDATA[
+<?php
+$mysqli = @new mysqli('localhost', 'fake_user', 'my_password', 'my_db');
+
+// Works as of PHP 5.2.9 and 5.3.0.
+if ($mysqli->connect_error) {
+ die('Connect Error: ' . $mysqli->connect_error);
+}
+?>
+]]>
+ </programlisting>
+ <para>&style.procedural;</para>
+ <programlisting role="php">
+<![CDATA[
+<?php
+$link = @mysqli_connect('localhost', 'fake_user', 'my_password', 'my_db');
+
+if (!$link) {
+ die('Connect Error: ' . mysqli_connect_error());
+}
+?>
+]]>
+ </programlisting>
+ &examples.outputs;
+ <screen>
+<![CDATA[
+Connect Error: Access denied for user 'fake_user'@'localhost' (using
password: YES)
+]]>
+ </screen>
+ </example>
+ </refsect1>
+
+ <refsect1 role="notes">
+ &reftitle.notes;
+ <warning>
+ <para>
+ The mysqli-&gt;connect_error property only works properly
+ as of PHP versions 5.2.9 and 5.3.0.
+ Use the <function>mysqli_connect_error</function>
+ function if compatibility with earlier PHP versions is required.
+ </para>
+ </warning>
+ </refsect1>
+
+ <refsect1 role="seealso">
+ &reftitle.seealso;
+ <para>
+ <simplelist>
+ <member><function>mysqli_connect</function></member>
+ <member><function>mysqli_connect_errno</function></member>
+ <member><function>mysqli_errno</function></member>
+ <member><function>mysqli_error</function></member>
+ <member><function>mysqli_sqlstate</function></member>
+ </simplelist>
+ </para>
+ </refsect1>
+
+</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:"~/.phpdoc/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
+-->
=======================================
--- /dev/null
+++ /trunk/xml/reference/mysqli/mysqli/connect.xml Sun Aug 14 01:16:33 2011
@@ -0,0 +1,298 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!-- $Revision: 304709 $ -->
+<refentry xml:id="mysqli.connect" xmlns="http://docbook.org/ns/docbook">
+ <refnamediv>
+ <refname>mysqli::__construct</refname>
+ <refname>mysqli_connect</refname>
+ <refpurpose>Open a new connection to the MySQL server</refpurpose>
+ </refnamediv>
+
+ <refsect1 role="description">
+ &reftitle.description;
+ <para>&style.oop;</para>
+ <constructorsynopsis>
+ <methodname>mysqli::__construct</methodname>
+ <methodparam
choice='opt'><type>string</type><parameter>host</parameter><initializer>ini_get("mysqli.default_host")</initializer></methodparam>
+ <methodparam
choice='opt'><type>string</type><parameter>username</parameter><initializer>ini_get("mysqli.default_user")</initializer></methodparam>
+ <methodparam
choice='opt'><type>string</type><parameter>passwd</parameter><initializer>ini_get("mysqli.default_pw")</initializer></methodparam>
+ <methodparam
choice='opt'><type>string</type><parameter>dbname</parameter><initializer>""</initializer></methodparam>
+ <methodparam
choice='opt'><type>int</type><parameter>port</parameter><initializer>ini_get("mysqli.default_port")</initializer></methodparam>
+ <methodparam
choice='opt'><type>string</type><parameter>socket</parameter><initializer>ini_get("mysqli.default_socket")</initializer></methodparam>
+ </constructorsynopsis>
+ <para>&style.procedural;</para>
+ <methodsynopsis>
+ <type>mysqli</type><methodname>mysqli_connect</methodname>
+ <methodparam
choice='opt'><type>string</type><parameter>host</parameter><initializer>ini_get("mysqli.default_host")</initializer></methodparam>
+ <methodparam
choice='opt'><type>string</type><parameter>username</parameter><initializer>ini_get("mysqli.default_user")</initializer></methodparam>
+ <methodparam
choice='opt'><type>string</type><parameter>passwd</parameter><initializer>ini_get("mysqli.default_pw")</initializer></methodparam>
+ <methodparam
choice='opt'><type>string</type><parameter>dbname</parameter><initializer>""</initializer></methodparam>
+ <methodparam
choice='opt'><type>int</type><parameter>port</parameter><initializer>ini_get("mysqli.default_port")</initializer></methodparam>
+ <methodparam
choice='opt'><type>string</type><parameter>socket</parameter><initializer>ini_get("mysqli.default_socket")</initializer></methodparam>
+ </methodsynopsis>
+ <para>
+ Opens a connection to the MySQL Server running on.
+ </para>
+ </refsect1>
+
+ <refsect1 role="parameters">
+ &reftitle.parameters;
+ <para>
+ <variablelist>
+ <varlistentry>
+ <term><parameter>host</parameter></term>
+ <listitem>
+ <para>
+ Can be either a host name or an IP address. Passing the &null; value
+ or the string "localhost" to this parameter, the local host is
+ assumed. When possible, pipes will be used instead of the TCP/IP
+ protocol.
+ </para>
+ <para>
+ Prepending host by <literal>p:</literal> opens a persistent
connection.
+ <function>mysqli_change_user</function> is automatically called on
+ connections opened from the connection pool.
+ </para>
+ </listitem>
+ </varlistentry>
+ <varlistentry>
+ <term><parameter>username</parameter></term>
+ <listitem>
+ <para>
+ The MySQL user name.
+ </para>
+ </listitem>
+ </varlistentry>
+ <varlistentry>
+ <term><parameter>passwd</parameter></term>
+ <listitem>
+ <para>
+ If not provided or &null;, the MySQL server will attempt to
authenticate
+ the user against those user records which have no password only.
This
+ allows one username to be used with different permissions (depending
+ on if a password as provided or not).
+ </para>
+ </listitem>
+ </varlistentry>
+ <varlistentry>
+ <term><parameter>dbname</parameter></term>
+ <listitem>
+ <para>
+ If provided will specify the default database to be used when
+ performing queries.
+ </para>
+ </listitem>
+ </varlistentry>
+ <varlistentry>
+ <term><parameter>port</parameter></term>
+ <listitem>
+ <para>
+ Specifies the port number to attempt to connect to the MySQL server.
+ </para>
+ </listitem>
+ </varlistentry>
+ <varlistentry>
+ <term><parameter>socket</parameter></term>
+ <listitem>
+ <para>
+ Specifies the socket or named pipe that should be used.
+ </para>
+ <note>
+ <para>
+ Specifying the <parameter>socket</parameter> parameter will not
+ explicitly determine the type of connection to be used when
+ connecting to the MySQL server. How the connection is made to the
+ MySQL database is determined by the <parameter>host</parameter>
+ parameter.
+ </para>
+ </note>
+ </listitem>
+ </varlistentry>
+ </variablelist>
+ </para>
+ </refsect1>
+
+ <refsect1 role="returnvalues">
+ &reftitle.returnvalues;
+ <para>
+ Returns an object which represents the connection to a MySQL Server.
+ </para>
+ </refsect1>
+
+ <refsect1 role="changelog">
+ &reftitle.changelog;
+ <para>
+ <informaltable>
+ <tgroup cols="2">
+ <thead>
+ <row>
+ <entry>&Version;</entry>
+ <entry>&Description;</entry>
+ </row>
+ </thead>
+ <tbody>
+ <row>
+ <entry>5.3.0</entry>
+ <entry>
+ Added the ability of persistent connections.
+ </entry>
+ </row>
+ </tbody>
+ </tgroup>
+ </informaltable>
+ </para>
+ </refsect1>
+
+ <refsect1 role="examples">
+ &reftitle.examples;
+ <example>
+ <title><methodname>mysqli::__construct</methodname> example</title>
+ <para>&style.oop;</para>
+ <programlisting role="php">
+<![CDATA[
+<?php
+$mysqli = new mysqli('localhost', 'my_user', 'my_password', 'my_db');
+
+/*
+ * This is the "official" OO way to do it,
+ * BUT $connect_error was broken until PHP 5.2.9 and 5.3.0.
+ */
+if ($mysqli->connect_error) {
+ die('Connect Error (' . $mysqli->connect_errno . ') '
+ . $mysqli->connect_error);
+}
+
+/*
+ * Use this instead of $connect_error if you need to ensure
+ * compatibility with PHP versions prior to 5.2.9 and 5.3.0.
+ */
+if (mysqli_connect_error()) {
+ die('Connect Error (' . mysqli_connect_errno() . ') '
+ . mysqli_connect_error());
+}
+
+echo 'Success... ' . $mysqli->host_info . "\n";
+
+$mysqli->close();
+?>
+]]>
+ </programlisting>
+ <para>&style.oop; when extending mysqli class</para>
+ <programlisting role="php">
+<![CDATA[
+<?php
+
+class foo_mysqli extends mysqli {
+ public function __construct($host, $user, $pass, $db) {
+ parent::__construct($host, $user, $pass, $db);
+
+ if (mysqli_connect_error()) {
+ die('Connect Error (' . mysqli_connect_errno() . ') '
+ . mysqli_connect_error());
+ }
+ }
+}
+
+$db = new foo_mysqli('localhost', 'my_user', 'my_password', 'my_db');
+
+echo 'Success... ' . $db->host_info . "\n";
+
+$db->close();
+?>
+]]>
+ </programlisting>
+ <para>&style.procedural;</para>
+ <programlisting role="php">
+<![CDATA[
+<?php
+$link = mysqli_connect('localhost', 'my_user', 'my_password', 'my_db');
+
+if (!$link) {
+ die('Connect Error (' . mysqli_connect_errno() . ') '
+ . mysqli_connect_error());
+}
+
+echo 'Success... ' . mysqli_get_host_info($link) . "\n";
+
+mysqli_close($link);
+?>
+]]>
+ </programlisting>
+ &examples.outputs;
+ <screen>
+<![CDATA[
+Success... MySQL host info: localhost via TCP/IP
+]]>
+ </screen>
+ </example>
+ </refsect1>
+
+ <refsect1 role="notes">
+ &reftitle.notes;
+ &mysqli.charset.note;
+ <note>
+ <para>
+ OO syntax only: If a connection fails an object is still returned. To
check
+ if the connection failed then use either the
+ <function>mysqli_connect_error</function> function or the <link
+ linkend="mysqli.connect-error">mysqli->connect_error</link> property
as in
+ the preceding examples.
+ </para>
+ </note>
+ <note>
+ <para>
+ If it is necessary to set options, such as the connection timeout,
+ <function>mysqli_real_connect</function> must be used instead.
+ </para>
+ </note>
+ <note>
+ <para>
+ Calling the constructor with no parameters is the same as calling
+ <function>mysqli_init</function>.
+ </para>
+ </note>
+ <note>
+ <para>
+ Error "Can't create TCP/IP socket (10106)" usually means that the <link
+ linkend="ini.variables-order">variables_order</link> configure
directive
+ doesn't contain character <literal>E</literal>. On Windows, if the
+ environment is not copied the <literal>SYSTEMROOT</literal> environment
+ variable won't be available and PHP will have problems loading Winsock.
+ </para>
+ </note>
+ </refsect1>
+
+ <refsect1 role="seealso">
+ &reftitle.seealso;
+ <para>
+ <simplelist>
+ <member><function>mysqli_real_connect</function></member>
+ <member><function>mysqli_options</function></member>
+ <member><function>mysqli_connect_errno</function></member>
+ <member><function>mysqli_connect_error</function></member>
+ <member><function>mysqli_close</function></member>
+ </simplelist>
+ </para>
+ </refsect1>
+
+</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:"~/.phpdoc/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
+-->
=======================================
--- /dev/null
+++ /trunk/xml/reference/mysqli/mysqli/debug.xml Sun Aug 14 01:16:33 2011
@@ -0,0 +1,110 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!-- $Revision: 299158 $ -->
+<refentry xml:id="mysqli.debug" xmlns="http://docbook.org/ns/docbook">
+ <refnamediv>
+ <refname>mysqli::debug</refname>
+ <refname>mysqli_debug</refname>
+ <refpurpose>Performs debugging operations</refpurpose>
+ </refnamediv>
+
+ <refsect1 role="description">
+ &reftitle.description;
+ <para>&style.oop;</para>
+ <methodsynopsis>
+ <type>bool</type><methodname>mysqli::debug</methodname>
+
<methodparam><type>string</type><parameter>message</parameter></methodparam>
+ </methodsynopsis>
+ <para>&style.procedural;</para>
+ <methodsynopsis>
+ <type>bool</type><methodname>mysqli_debug</methodname>
+
<methodparam><type>string</type><parameter>message</parameter></methodparam>
+ </methodsynopsis>
+ <para>
+ Performs debugging operations using the Fred Fish debugging library.
+ </para>
+ </refsect1>
+
+ <refsect1 role="parameters">
+ &reftitle.parameters;
+ <para>
+ <variablelist>
+ <varlistentry>
+ <term><parameter>message</parameter></term>
+ <listitem>
+ <para>
+ A string representing the debugging operation to perform
+ </para>
+ </listitem>
+ </varlistentry>
+ </variablelist>
+ </para>
+ </refsect1>
+
+ <refsect1 role="returnvalues">
+ &reftitle.returnvalues;
+ <para>
+ Returns &true;.
+ </para>
+ </refsect1>
+
+ <refsect1 role="notes">
+ &reftitle.notes;
+ <note>
+ <para>
+ To use the <function>mysqli_debug</function> function you must compile
+ the MySQL client library to support debugging.
+ </para>
+ </note>
+ </refsect1>
+
+ <refsect1 role="examples">
+ &reftitle.examples;
+ <para>
+ <example>
+ <title>Generating a Trace File</title>
+ <programlisting role="php">
+<![CDATA[
+<?php
+
+/* Create a trace file in '/tmp/client.trace' on the local (client)
machine: */
+mysqli_debug("d:t:o,/tmp/client.trace");
+
+?>
+]]>
+ </programlisting>
+ </example>
+ </para>
+ </refsect1>
+
+ <refsect1 role="seealso">
+ &reftitle.seealso;
+ <para>
+ <simplelist>
+ <member><function>mysqli_dump_debug_info</function></member>
+ <member><function>mysqli_report</function></member>
+ </simplelist>
+ </para>
+ </refsect1>
+
+</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:"~/.phpdoc/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
+-->
=======================================
--- /dev/null
+++ /trunk/xml/reference/mysqli/mysqli/dump-debug-info.xml Sun Aug 14
01:16:33 2011
@@ -0,0 +1,73 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!-- $Revision: 299158 $ -->
+<refentry xml:id="mysqli.dump-debug-info"
xmlns="http://docbook.org/ns/docbook">
+ <refnamediv>
+ <refname>mysqli::dump_debug_info</refname>
+ <refname>mysqli_dump_debug_info</refname>
+ <refpurpose>将调试信息输出到日志</refpurpose>
+ </refnamediv>
+
+ <refsect1 role="description">
+ &reftitle.description;
+ <para>&style.oop;</para>
+ <methodsynopsis>
+ <type>bool</type><methodname>mysqli::dump_debug_info</methodname>
+ <void/>
+ </methodsynopsis>
+ <para>&style.procedural;</para>
+ <methodsynopsis>
+ <type>bool</type><methodname>mysqli_dump_debug_info</methodname>
+
<methodparam><type>mysqli</type><parameter>link</parameter></methodparam>
+ </methodsynopsis>
+ <para>
+ 这个函数设计用于超级权限用户执行将调试信息输出到连接相关的MySQL服务端日志
+ </para>
+ </refsect1>
+
+ <refsect1 role="parameters">
+ &reftitle.parameters;
+ <para>
+ <variablelist>
+ &mysqli.link.description;
+ </variablelist>
+ </para>
+ </refsect1>
+
+ <refsect1 role="returnvalues">
+ &reftitle.returnvalues;
+ <para>
+ &return.success;
+ </para>
+ </refsect1>
+
+ <refsect1 role="seealso">
+ &reftitle.seealso;
+ <para>
+ <simplelist>
+ <member><function>mysqli_debug</function></member>
+ </simplelist>
+ </para>
+ </refsect1>
+
+</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:"~/.phpdoc/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
+-->
=======================================
--- /dev/null
+++ /trunk/xml/reference/mysqli/mysqli/errno.xml Sun Aug 14 01:16:33 2011
@@ -0,0 +1,136 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!-- $Revision: 299196 $ -->
+<refentry xml:id="mysqli.errno" xmlns="http://docbook.org/ns/docbook">
+ <refnamediv>
+ <refname>mysqli->errno</refname>
+ <refname>mysqli_errno</refname>
+ <refpurpose>返回最近函数调用的错误代码</refpurpose>
+ </refnamediv>
+
+ <refsect1 role="description">
+ &reftitle.description;
+ <para>&style.oop;</para>
+ <classsynopsis>
+ <ooclass><classname>mysqli</classname></ooclass>
+ <fieldsynopsis><type>int</type><varname>errno</varname></fieldsynopsis>
+ </classsynopsis>
+ <para>&style.procedural;</para>
+ <methodsynopsis>
+ <type>int</type><methodname>mysqli_errno</methodname>
+
<methodparam><type>mysqli</type><parameter>link</parameter></methodparam>
+ </methodsynopsis>
+ <para>
+ 返回最近的mysqli函数调用产生的错误代码.
+ </para>
+ <para>
+ 客户端错误在Mysql<filename>errmsg.h</filename>头文件中列出,
+ 服务端错误好在<filename>mysqld_error.h</filename>中列出.
+ 在mysql源码分发包中的<filename>Docs/mysqld_error.txt</filename>你可以发现
一个完整的错误消息和错误号.
+ </para>
+ </refsect1>
+
+ <refsect1 role="parameters">
+ &reftitle.parameters;
+ <para>
+ <variablelist>
+ &mysqli.link.description;
+ </variablelist>
+ </para>
+ </refsect1>
+
+ <refsect1 role="returnvalues">
+ &reftitle.returnvalues;
+ <para>
+ 最后一次调用产生的错误代码, 返回0代表没有错误发生.
+ </para>
+ </refsect1>
+
+ <refsect1 role="examples">
+ &reftitle.examples;
+ <example>
+ <title><varname>mysqli->errno</varname> example</title>
+ <para>&style.oop;</para>
+ <programlisting role="php">
+<![CDATA[
+<?php
+$mysqli = new mysqli("localhost", "my_user", "my_password", "world");
+
+/* 检查连接 */
+if (mysqli_connect_errno()) {
+ printf("Connect failed: %s\n", mysqli_connect_error());
+ exit();
+}
+
+if (!$mysqli->query("SET a=1")) {
+ printf("Errorcode: %d\n", $mysqli->errno);
+}
+
+/* 关闭连接 */
+$mysqli->close();
+?>
+]]>
+ </programlisting>
+ <para>&style.procedural;</para>
+ <programlisting role="php">
+<![CDATA[
+<?php
+$link = mysqli_connect("localhost", "my_user", "my_password", "world");
+
+/* 检查连接 */
+if (mysqli_connect_errno()) {
+ printf("Connect failed: %s\n", mysqli_connect_error());
+ exit();
+}
+
+if (!mysqli_query($link, "SET a=1")) {
+ printf("Errorcode: %d\n", mysqli_errno($link));
+}
+
+/* 关闭连接 */
+mysqli_close($link);
+?>
+]]>
+ </programlisting>
+ &examples.outputs;
+ <screen>
+<![CDATA[
+Errorcode: 1193
+]]>
+ </screen>
+ </example>
+ </refsect1>
+
+ <refsect1 role="seealso">
+ &reftitle.seealso;
+ <para>
+ <simplelist>
+ <member><function>mysqli_connect_errno</function></member>
+ <member><function>mysqli_connect_error</function></member>
+ <member><function>mysqli_error</function></member>
+ <member><function>mysqli_sqlstate</function></member>
+ </simplelist>
+ </para>
+ </refsect1>
+
+</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:"~/.phpdoc/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
+-->
=======================================
--- /dev/null
+++ /trunk/xml/reference/mysqli/mysqli/error.xml Sun Aug 14 01:16:33 2011
@@ -0,0 +1,132 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!-- $Revision: 299196 $ -->
+<refentry xml:id="mysqli.error" xmlns="http://docbook.org/ns/docbook">
+ <refnamediv>
+ <refname>mysqli->error</refname>
+ <refname>mysqli_error</refname>
+ <refpurpose>Returns a string description of the last error</refpurpose>
+ </refnamediv>
+
+ <refsect1 role="description">
+ &reftitle.description;
+ <para>&style.oop;</para>
+ <classsynopsis>
+ <ooclass><classname>mysqli</classname></ooclass>
+
<fieldsynopsis><type>string</type><varname>error</varname></fieldsynopsis>
+ </classsynopsis>
+ <para>&style.procedural;</para>
+ <methodsynopsis>
+ <type>string</type><methodname>mysqli_error</methodname>
+
<methodparam><type>mysqli</type><parameter>link</parameter></methodparam>
+ </methodsynopsis>
+ <para>
+ Returns the last error message for the most recent MySQLi function call
+ that can succeed or fail.
+ </para>
+ </refsect1>
+
+ <refsect1 role="parameters">
+ &reftitle.parameters;
+ <para>
+ <variablelist>
+ &mysqli.link.description;
+ </variablelist>
+ </para>
+ </refsect1>
+
+ <refsect1 role="returnvalues">
+ &reftitle.returnvalues;
+ <para>
+ A string that describes the error. An empty string if no error
occurred.
+ </para>
+ </refsect1>
+
+ <refsect1 role="examples">
+ &reftitle.examples;
+ <example>
+ <title><varname>mysqli->error</varname> example</title>
+ <para>&style.oop;</para>
+ <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();
+}
+
+if (!$mysqli->query("SET a=1")) {
+ printf("Errormessage: %s\n", $mysqli->error);
+}
+
+/* close connection */
+$mysqli->close();
+?>
+]]>
+ </programlisting>
+ <para>&style.procedural;</para>
+ <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();
+}
+
+if (!mysqli_query($link, "SET a=1")) {
+ printf("Errormessage: %s\n", mysqli_error($link));
+}
+
+/* close connection */
+mysqli_close($link);
+?>
+]]>
+ </programlisting>
+ &examples.outputs;
+ <screen>
+<![CDATA[
+Errormessage: Unknown system variable 'a'
+]]>
+ </screen>
+ </example>
+ </refsect1>
+
+ <refsect1 role="seealso">
+ &reftitle.seealso;
+ <para>
+ <simplelist>
+ <member><function>mysqli_connect_errno</function></member>
+ <member><function>mysqli_connect_error</function></member>
+ <member><function>mysqli_errno</function></member>
+ <member><function>mysqli_sqlstate</function></member>
+ </simplelist>
+ </para>
+ </refsect1>
+
+</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:"~/.phpdoc/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
+-->
=======================================
--- /dev/null
+++ /trunk/xml/reference/mysqli/mysqli/field-count.xml Sun Aug 14 01:16:33
2011
@@ -0,0 +1,134 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!-- $Revision: 299196 $ -->
+<refentry xml:id="mysqli.field-count"
xmlns="http://docbook.org/ns/docbook">
+ <refnamediv>
+ <refname>mysqli->field_count</refname>
+ <refname>mysqli_field_count</refname>
+ <refpurpose>Returns the number of columns for the most recent
query</refpurpose>
+ </refnamediv>
+
+ <refsect1 role="description">
+ &reftitle.description;
+ <para>&style.oop;</para>
+ <classsynopsis>
+ <ooclass><classname>mysqli_result</classname></ooclass>
+
<fieldsynopsis><type>int</type><varname>field_count</varname></fieldsynopsis>
+ </classsynopsis>
+ <para>&style.procedural;</para>
+ <methodsynopsis>
+ <type>int</type><methodname>mysqli_field_count</methodname>
+
<methodparam><type>mysqli</type><parameter>link</parameter></methodparam>
+ </methodsynopsis>
+ <para>
+ Returns the number of columns for the most recent query on the
connection
+ represented by the <parameter>link</parameter> parameter. This function
+ can be useful when using the <function>mysqli_store_result</function>
+ function to determine if the query should have produced a non-empty
result
+ set or not without knowing the nature of the query.
+ </para>
+ </refsect1>
+
+ <refsect1 role="parameters">
+ &reftitle.parameters;
+ <para>
+ <variablelist>
+ &mysqli.link.description;
+ </variablelist>
+ </para>
+ </refsect1>
+
+ <refsect1 role="returnvalues">
+ &reftitle.returnvalues;
+ <para>
+ An integer representing the number of fields in a result set.
+ </para>
+ </refsect1>
+
+ <refsect1 role="examples">
+ &reftitle.examples;
+ <example>
+ <title><varname>mysqli->field_count</varname> example</title>
+ <para>&style.oop;</para>
+ <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')");
+
+
+$mysqli->real_query("SELECT * FROM friends");
+
+if ($mysqli->field_count) {
+ /* this was a select/show or describe query */
+ $result = $mysqli->store_result();
+
+ /* process resultset */
+ $row = $result->fetch_row();
+
+ /* free resultset */
+ $result->close();
+}
+
+/* close connection */
+$mysqli->close();
+?>
+]]>
+ </programlisting>
+ <para>&style.procedural;</para>
+ <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')");
+
+mysqli_real_query($link, "SELECT * FROM friends");
+
+if (mysqli_field_count($link)) {
+ /* this was a select/show or describe query */
+ $result = mysqli_store_result($link);
+
+ /* process resultset */
+ $row = mysqli_fetch_row($result);
+
+ /* free resultset */
+ mysqli_free_result($result);
+}
+
+/* close connection */
+mysqli_close($link);
+?>
+]]>
+ </programlisting>
+ </example>
+ </refsect1>
+
+</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:"~/.phpdoc/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
+-->
=======================================
--- /dev/null
+++ /trunk/xml/reference/mysqli/mysqli/get-charset.xml Sun Aug 14 01:16:33
2011
@@ -0,0 +1,155 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!-- $Revision: 299196 $ -->
+<refentry xml:id="mysqli.get-charset"
xmlns="http://docbook.org/ns/docbook">
+ <refnamediv>
+ <refname>mysqli::get_charset</refname>
+ <refname>mysqli_get_charset</refname>
+ <refpurpose>Returns a character set object</refpurpose>
+ </refnamediv>
+
+ <refsect1 role="description">
+ &reftitle.description;
+ <para>&style.oop;</para>
+ <methodsynopsis>
+ <type>object</type><methodname>mysqli::get_charset</methodname>
+ <void />
+ </methodsynopsis>
+ <para>&style.procedural;</para>
+ <methodsynopsis>
+ <type>object</type><methodname>mysqli_get_charset</methodname>
+
<methodparam><type>mysqli</type><parameter>link</parameter></methodparam>
+ </methodsynopsis>
+
+ <para>
+ Returns a character set object providing several properties
+ of the current active character set.
+ </para>
+
+ </refsect1>
+
+ <refsect1 role="parameters">
+ &reftitle.parameters;
+ <para>
+ <variablelist>
+ &mysqli.link.description;
+ </variablelist>
+ </para>
+ </refsect1>
+
+ <refsect1 role="returnvalues">
+ &reftitle.returnvalues;
+ <para>
+ The function returns a character set object with the following
properties:
+ <variablelist>
+ <varlistentry>
+ <term><parameter>charset</parameter></term>
+ <listitem><para>Character set name</para></listitem>
+ </varlistentry>
+ <varlistentry>
+ <term><parameter>collation</parameter></term>
+ <listitem><para>Collation name</para></listitem>
+ </varlistentry>
+ <varlistentry>
+ <term><parameter>dir</parameter></term>
+ <listitem><para>Directory the charset description was fetched from
(?) or "" for built-in character sets</para></listitem>
+ </varlistentry>
+ <varlistentry>
+ <term><parameter>min_length</parameter></term>
+ <listitem><para>Minimum character length in bytes</para></listitem>
+ </varlistentry>
+ <varlistentry>
+ <term><parameter>max_length</parameter></term>
+ <listitem><para>Maximum character length in bytes</para></listitem>
+ </varlistentry>
+ <varlistentry>
+ <term><parameter>number</parameter></term>
+ <listitem><para>Internal character set number</para></listitem>
+ </varlistentry>
+ <varlistentry>
+ <term><parameter>state</parameter></term>
+ <listitem><para>Character set status (?)</para></listitem>
+ </varlistentry>
+ </variablelist>
+ </para>
+ </refsect1>
+
+ <refsect1 role="examples">
+ &reftitle.examples;
+ <example>
+ <title><methodname>mysqli::get_charset</methodname> example</title>
+ <para>&style.oop;</para>
+ <programlisting role="php">
+<![CDATA[
+<?php
+ $db = mysqli_init();
+ $db->real_connect("localhost","root","","test");
+ var_dump($db->get_charset());
+?>
+]]>
+ </programlisting>
+ <para>&style.procedural;</para>
+ <programlisting role="php">
+<![CDATA[
+<?php
+ $db = mysqli_init();
+ mysqli_real_connect($db, "localhost","root","","test");
+ var_dump($db->get_charset());
+?>
+]]>
+ </programlisting>
+ &examples.outputs;
+ <screen>
+<![CDATA[
+object(stdClass)#2 (7) {
+ ["charset"]=>
+ string(6) "latin1"
+ ["collation"]=>
+ string(17) "latin1_swedish_ci"
+ ["dir"]=>
+ string(0) ""
+ ["min_length"]=>
+ int(1)
+ ["max_length"]=>
+ int(1)
+ ["number"]=>
+ int(8)
+ ["state"]=>
+ int(801)
+}
+]]>
+ </screen>
+ </example>
+ </refsect1>
+
+ <refsect1 role="seealso">
+ &reftitle.seealso;
+ <para>
+ <simplelist>
+ <member><function>mysqli_character_set_name</function></member>
+ <member><function>mysqli_set_charset</function></member>
+ </simplelist>
+ </para>
+ </refsect1>
+
+</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:"~/.phpdoc/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
+-->
=======================================
--- /dev/null
+++ /trunk/xml/reference/mysqli/mysqli/get-client-info.xml Sun Aug 14
01:16:33 2011
@@ -0,0 +1,86 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!-- $Revision: 299158 $ -->
+<refentry xml:id="mysqli.get-client-info"
xmlns="http://docbook.org/ns/docbook">
+ <refnamediv>
+ <refname>mysqli->get_client_info</refname>
+ <refname>mysqli_get_client_info</refname>
+ <refpurpose>Returns the MySQL client version as a string</refpurpose>
+ </refnamediv>
+
+ <refsect1 role="description">
+ &reftitle.description;
+ <para>&style.oop;</para>
+ <methodsynopsis>
+ <type>string</type><methodname>mysqli::get_client_info</methodname>
+ <void />
+ </methodsynopsis>
+ <para>&style.procedural;</para>
+ <methodsynopsis>
+ <type>string</type><methodname>mysqli_get_client_info</methodname>
+
<methodparam><type>mysqli</type><parameter>link</parameter></methodparam>
+ </methodsynopsis>
+ <para>
+ Returns a string that represents the MySQL client library version.
+ </para>
+ </refsect1>
+
+ <refsect1 role="returnvalues">
+ &reftitle.returnvalues;
+ <para>
+ A string that represents the MySQL client library version
+ </para>
+ </refsect1>
+
+ <refsect1 role="examples">
+ &reftitle.examples;
+ <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>
+
+ <refsect1 role="seealso">
+ &reftitle.seealso;
+ <para>
+ <simplelist>
+ <member><function>mysqli_get_client_version</function></member>
+ <member><function>mysqli_get_server_info</function></member>
+ <member><function>mysqli_get_server_version</function></member>
+ </simplelist>
+ </para>
+ </refsect1>
+
+</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:"~/.phpdoc/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
+-->
=======================================
--- /dev/null
+++ /trunk/xml/reference/mysqli/mysqli/get-client-stats.xml Sun Aug 14
01:16:33 2011
@@ -0,0 +1,206 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!-- $Revision: 305378 $ -->
+<refentry xml:id="mysqli.get-client-stats"
xmlns="http://docbook.org/ns/docbook"
xmlns:xlink="http://www.w3.org/1999/xlink">
+ <refnamediv>
+ <refname>mysqli_get_client_stats</refname>
+ <refpurpose>Returns client per-process statistics</refpurpose>
+ </refnamediv>
+
+ <refsect1 role="description">
+ &reftitle.description;
+ <methodsynopsis>
+ <type>array</type><methodname>mysqli_get_client_stats</methodname>
+ <void/>
+ </methodsynopsis>
+ <para>
+ Returns client per-process statistics.
+ &mysqli.available.mysqlnd;
+ </para>
+ </refsect1>
+
+ <refsect1 role="parameters">
+ &reftitle.parameters;
+ </refsect1>
+
+ <refsect1 role="returnvalues">
+ &reftitle.returnvalues;
+ <para>
+ Returns an array with client stats if success, &false; otherwise.
+ </para>
+ </refsect1>
+
+ <refsect1 role="examples">
+ &reftitle.examples;
+ <para>
+ <example>
+ <title>A <function>mysqli_get_client_stats</function> example</title>
+ <programlisting role="php">
+<![CDATA[
+<?php
+$link = mysqli_connect();
+print_r(mysqli_get_client_stats());
+?>
+]]>
+ </programlisting>
+ &example.outputs.similar;
+ <screen>
+<![CDATA[
+Array
+(
+ [bytes_sent] => 43
+ [bytes_received] => 80
+ [packets_sent] => 1
+ [packets_received] => 2
+ [protocol_overhead_in] => 8
+ [protocol_overhead_out] => 4
+ [bytes_received_ok_packet] => 11
+ [bytes_received_eof_packet] => 0
+ [bytes_received_rset_header_packet] => 0
+ [bytes_received_rset_field_meta_packet] => 0
+ [bytes_received_rset_row_packet] => 0
+ [bytes_received_prepare_response_packet] => 0
+ [bytes_received_change_user_packet] => 0
+ [packets_sent_command] => 0
+ [packets_received_ok] => 1
+ [packets_received_eof] => 0
+ [packets_received_rset_header] => 0
+ [packets_received_rset_field_meta] => 0
+ [packets_received_rset_row] => 0
+ [packets_received_prepare_response] => 0
+ [packets_received_change_user] => 0
+ [result_set_queries] => 0
+ [non_result_set_queries] => 0
+ [no_index_used] => 0
+ [bad_index_used] => 0
+ [slow_queries] => 0
+ [buffered_sets] => 0
+ [unbuffered_sets] => 0
+ [ps_buffered_sets] => 0
+ [ps_unbuffered_sets] => 0
+ [flushed_normal_sets] => 0
+ [flushed_ps_sets] => 0
+ [ps_prepared_never_executed] => 0
+ [ps_prepared_once_executed] => 0
+ [rows_fetched_from_server_normal] => 0
+ [rows_fetched_from_server_ps] => 0
+ [rows_buffered_from_client_normal] => 0
+ [rows_buffered_from_client_ps] => 0
+ [rows_fetched_from_client_normal_buffered] => 0
+ [rows_fetched_from_client_normal_unbuffered] => 0
+ [rows_fetched_from_client_ps_buffered] => 0
+ [rows_fetched_from_client_ps_unbuffered] => 0
+ [rows_fetched_from_client_ps_cursor] => 0
+ [rows_skipped_normal] => 0
+ [rows_skipped_ps] => 0
+ [copy_on_write_saved] => 0
+ [copy_on_write_performed] => 0
+ [command_buffer_too_small] => 0
+ [connect_success] => 1
+ [connect_failure] => 0
+ [connection_reused] => 0
+ [reconnect] => 0
+ [pconnect_success] => 0
+ [active_connections] => 1
+ [active_persistent_connections] => 0
+ [explicit_close] => 0
+ [implicit_close] => 0
+ [disconnect_close] => 0
+ [in_middle_of_command_close] => 0
+ [explicit_free_result] => 0
+ [implicit_free_result] => 0
+ [explicit_stmt_close] => 0
+ [implicit_stmt_close] => 0
+ [mem_emalloc_count] => 0
+ [mem_emalloc_ammount] => 0
+ [mem_ecalloc_count] => 0
+ [mem_ecalloc_ammount] => 0
+ [mem_erealloc_count] => 0
+ [mem_erealloc_ammount] => 0
+ [mem_efree_count] => 0
+ [mem_malloc_count] => 0
+ [mem_malloc_ammount] => 0
+ [mem_calloc_count] => 0
+ [mem_calloc_ammount] => 0
+ [mem_realloc_count] => 0
+ [mem_realloc_ammount] => 0
+ [mem_free_count] => 0
+ [proto_text_fetched_null] => 0
+ [proto_text_fetched_bit] => 0
+ [proto_text_fetched_tinyint] => 0
+ [proto_text_fetched_short] => 0
+ [proto_text_fetched_int24] => 0
+ [proto_text_fetched_int] => 0
+ [proto_text_fetched_bigint] => 0
+ [proto_text_fetched_decimal] => 0
+ [proto_text_fetched_float] => 0
+ [proto_text_fetched_double] => 0
+ [proto_text_fetched_date] => 0
+ [proto_text_fetched_year] => 0
+ [proto_text_fetched_time] => 0
+ [proto_text_fetched_datetime] => 0
+ [proto_text_fetched_timestamp] => 0
+ [proto_text_fetched_string] => 0
+ [proto_text_fetched_blob] => 0
+ [proto_text_fetched_enum] => 0
+ [proto_text_fetched_set] => 0
+ [proto_text_fetched_geometry] => 0
+ [proto_text_fetched_other] => 0
+ [proto_binary_fetched_null] => 0
+ [proto_binary_fetched_bit] => 0
+ [proto_binary_fetched_tinyint] => 0
+ [proto_binary_fetched_short] => 0
+ [proto_binary_fetched_int24] => 0
+ [proto_binary_fetched_int] => 0
+ [proto_binary_fetched_bigint] => 0
+ [proto_binary_fetched_decimal] => 0
+ [proto_binary_fetched_float] => 0
+ [proto_binary_fetched_double] => 0
+ [proto_binary_fetched_date] => 0
+ [proto_binary_fetched_year] => 0
+ [proto_binary_fetched_time] => 0
+ [proto_binary_fetched_datetime] => 0
+ [proto_binary_fetched_timestamp] => 0
+ [proto_binary_fetched_string] => 0
+ [proto_binary_fetched_blob] => 0
+ [proto_binary_fetched_enum] => 0
+ [proto_binary_fetched_set] => 0
+ [proto_binary_fetched_geometry] => 0
+ [proto_binary_fetched_other] => 0
+)
+]]>
+ </screen>
+ </example>
+ </para>
+ </refsect1>
+
+ <refsect1 role="seealso">
+ &reftitle.seealso;
+ <para>
+ <simplelist>
+ <member><link linkend="mysqlnd.stats">Stats description</link></member>
+ </simplelist>
+ </para>
+ </refsect1>
+
+</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:"~/.phpdoc/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
+-->
=======================================
--- /dev/null
+++ /trunk/xml/reference/mysqli/mysqli/get-client-version.xml Sun Aug 14
01:16:33 2011
@@ -0,0 +1,92 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!-- $Revision: 299158 $ -->
+<refentry xml:id="mysqli.get-client-version"
xmlns="http://docbook.org/ns/docbook">
+ <refnamediv>
+ <refname>mysqli->client_version</refname>
+ <refname>mysqli_get_client_version</refname>
+ <refpurpose>Get MySQL client info</refpurpose>
+ </refnamediv>
+
+ <refsect1 role="description">
+ &reftitle.description;
+ <para>&style.oop;</para>
+ <classsynopsis>
+ <ooclass><classname>mysqli</classname></ooclass>
+
<fieldsynopsis><type>int</type><varname>client_version</varname></fieldsynopsis>
+ </classsynopsis>
+ <para>&style.procedural;</para>
+ <methodsynopsis>
+ <type>int</type><methodname>mysqli_get_client_version</methodname>
+
<methodparam><type>mysqli</type><parameter>link</parameter></methodparam>
+ </methodsynopsis>
+ <para>
+ Returns client version number as an integer.
+ </para>
+ </refsect1>
+
+ <refsect1 role="returnvalues">
+ &reftitle.returnvalues;
+ <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 role="examples">
+ &reftitle.examples;
+ <para>
+ <example>
+ <title>mysqli_get_client_version</title>
+ <programlisting role='php'>
+<![CDATA[
+<?php
+
+/* 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>
+
+ <refsect1 role="seealso">
+ &reftitle.seealso;
+ <para>
+ <simplelist>
+ <member><function>mysqli_get_client_info</function></member>
+ <member><function>mysqli_get_server_info</function></member>
+ <member><function>mysqli_get_server_version</function></member>
+ </simplelist>
+ </para>
+ </refsect1>
+
+</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:"~/.phpdoc/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
+-->
=======================================
--- /dev/null
+++ /trunk/xml/reference/mysqli/mysqli/get-connection-stats.xml Sun Aug 14
01:16:33 2011
@@ -0,0 +1,216 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!-- $Revision: 305374 $ -->
+<refentry xml:id="mysqli.get-connection-stats"
xmlns="http://docbook.org/ns/docbook"
xmlns:xlink="http://www.w3.org/1999/xlink">
+ <refnamediv>
+ <refname>mysqli::get_connection_stats</refname>
+ <refname>mysqli_get_connection_stats</refname>
+ <refpurpose>Returns statistics about the client connection</refpurpose>
+ </refnamediv>
+
+ <refsect1 role="description">
+ &reftitle.description;
+ <para>&style.oop;</para>
+ <methodsynopsis>
+ <type>bool</type><methodname>mysqli::get_connection_stats</methodname>
+ <void/>
+ </methodsynopsis>
+ <para>&style.procedural;</para>
+ <methodsynopsis>
+ <type>array</type><methodname>mysqli_get_connection_stats</methodname>
+
<methodparam><type>mysqli</type><parameter>link</parameter></methodparam>
+ </methodsynopsis>
+ <para>
+ Returns statistics about the client connection.
+ &mysqli.available.mysqlnd;
+ </para>
+ </refsect1>
+
+ <refsect1 role="parameters">
+ &reftitle.parameters;
+ <variablelist>
+ &mysqli.link.description;
+ </variablelist>
+ </refsect1>
+
+ <refsect1 role="returnvalues">
+ &reftitle.returnvalues;
+ <para>
+ Returns an array with connection stats if success, &false; otherwise.
+ </para>
+ </refsect1>
+
+ <refsect1 role="examples">
+ &reftitle.examples;
+ <para>
+ <example>
+ <title>A <function>mysqli_get_connection_stats</function>
example</title>
+ <programlisting role="php">
+<![CDATA[
+<?php
+$link = mysqli_connect();
+print_r(mysqli_get_connection_stats($link));
+?>
+]]>
+ </programlisting>
+ &example.outputs.similar;
+ <screen>
+<![CDATA[
+Array
+(
+ [bytes_sent] => 43
+ [bytes_received] => 80
+ [packets_sent] => 1
+ [packets_received] => 2
+ [protocol_overhead_in] => 8
+ [protocol_overhead_out] => 4
+ [bytes_received_ok_packet] => 11
+ [bytes_received_eof_packet] => 0
+ [bytes_received_rset_header_packet] => 0
+ [bytes_received_rset_field_meta_packet] => 0
+ [bytes_received_rset_row_packet] => 0
+ [bytes_received_prepare_response_packet] => 0
+ [bytes_received_change_user_packet] => 0
+ [packets_sent_command] => 0
+ [packets_received_ok] => 1
+ [packets_received_eof] => 0
+ [packets_received_rset_header] => 0
+ [packets_received_rset_field_meta] => 0
+ [packets_received_rset_row] => 0
+ [packets_received_prepare_response] => 0
+ [packets_received_change_user] => 0
+ [result_set_queries] => 0
+ [non_result_set_queries] => 0
+ [no_index_used] => 0
+ [bad_index_used] => 0
+ [slow_queries] => 0
+ [buffered_sets] => 0
+ [unbuffered_sets] => 0
+ [ps_buffered_sets] => 0
+ [ps_unbuffered_sets] => 0
+ [flushed_normal_sets] => 0
+ [flushed_ps_sets] => 0
+ [ps_prepared_never_executed] => 0
+ [ps_prepared_once_executed] => 0
+ [rows_fetched_from_server_normal] => 0
+ [rows_fetched_from_server_ps] => 0
+ [rows_buffered_from_client_normal] => 0
+ [rows_buffered_from_client_ps] => 0
+ [rows_fetched_from_client_normal_buffered] => 0
+ [rows_fetched_from_client_normal_unbuffered] => 0
+ [rows_fetched_from_client_ps_buffered] => 0
+ [rows_fetched_from_client_ps_unbuffered] => 0
+ [rows_fetched_from_client_ps_cursor] => 0
+ [rows_skipped_normal] => 0
+ [rows_skipped_ps] => 0
+ [copy_on_write_saved] => 0
+ [copy_on_write_performed] => 0
+ [command_buffer_too_small] => 0
+ [connect_success] => 1
+ [connect_failure] => 0
+ [connection_reused] => 0
+ [reconnect] => 0
+ [pconnect_success] => 0
+ [active_connections] => 1
+ [active_persistent_connections] => 0
+ [explicit_close] => 0
+ [implicit_close] => 0
+ [disconnect_close] => 0
+ [in_middle_of_command_close] => 0
+ [explicit_free_result] => 0
+ [implicit_free_result] => 0
+ [explicit_stmt_close] => 0
+ [implicit_stmt_close] => 0
+ [mem_emalloc_count] => 0
+ [mem_emalloc_ammount] => 0
+ [mem_ecalloc_count] => 0
+ [mem_ecalloc_ammount] => 0
+ [mem_erealloc_count] => 0
+ [mem_erealloc_ammount] => 0
+ [mem_efree_count] => 0
+ [mem_malloc_count] => 0
+ [mem_malloc_ammount] => 0
+ [mem_calloc_count] => 0
+ [mem_calloc_ammount] => 0
+ [mem_realloc_count] => 0
+ [mem_realloc_ammount] => 0
+ [mem_free_count] => 0
+ [proto_text_fetched_null] => 0
+ [proto_text_fetched_bit] => 0
+ [proto_text_fetched_tinyint] => 0
+ [proto_text_fetched_short] => 0
+ [proto_text_fetched_int24] => 0
+ [proto_text_fetched_int] => 0
+ [proto_text_fetched_bigint] => 0
+ [proto_text_fetched_decimal] => 0
+ [proto_text_fetched_float] => 0
+ [proto_text_fetched_double] => 0
+ [proto_text_fetched_date] => 0
+ [proto_text_fetched_year] => 0
+ [proto_text_fetched_time] => 0
+ [proto_text_fetched_datetime] => 0
+ [proto_text_fetched_timestamp] => 0
+ [proto_text_fetched_string] => 0
+ [proto_text_fetched_blob] => 0
+ [proto_text_fetched_enum] => 0
+ [proto_text_fetched_set] => 0
+ [proto_text_fetched_geometry] => 0
+ [proto_text_fetched_other] => 0
+ [proto_binary_fetched_null] => 0
+ [proto_binary_fetched_bit] => 0
+ [proto_binary_fetched_tinyint] => 0
+ [proto_binary_fetched_short] => 0
+ [proto_binary_fetched_int24] => 0
+ [proto_binary_fetched_int] => 0
+ [proto_binary_fetched_bigint] => 0
+ [proto_binary_fetched_decimal] => 0
+ [proto_binary_fetched_float] => 0
+ [proto_binary_fetched_double] => 0
+ [proto_binary_fetched_date] => 0
+ [proto_binary_fetched_year] => 0
+ [proto_binary_fetched_time] => 0
+ [proto_binary_fetched_datetime] => 0
+ [proto_binary_fetched_timestamp] => 0
+ [proto_binary_fetched_string] => 0
+ [proto_binary_fetched_blob] => 0
+ [proto_binary_fetched_enum] => 0
+ [proto_binary_fetched_set] => 0
+ [proto_binary_fetched_geometry] => 0
+ [proto_binary_fetched_other] => 0
+)
+]]>
+ </screen>
+ </example>
+ </para>
+ </refsect1>
+
+ <refsect1 role="seealso">
+ &reftitle.seealso;
+ <para>
+ <simplelist>
+ <member><link linkend="mysqlnd.stats">Stats description</link></member>
+ </simplelist>
+ </para>
+ </refsect1>
+
+</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:"~/.phpdoc/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
+-->
=======================================
--- /dev/null
+++ /trunk/xml/reference/mysqli/mysqli/get-host-info.xml Sun Aug 14
01:16:33 2011
@@ -0,0 +1,128 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!-- $Revision: 299196 $ -->
+<refentry xml:id="mysqli.get-host-info"
xmlns="http://docbook.org/ns/docbook">
+ <refnamediv>
+ <refname>mysqli->host_info</refname>
+ <refname>mysqli_get_host_info</refname>
+ <refpurpose>Returns a string representing the type of connection
used</refpurpose>
+ </refnamediv>
+
+ <refsect1 role="description">
+ &reftitle.description;
+ <para>&style.oop;</para>
+ <classsynopsis>
+ <ooclass><classname>mysqli</classname></ooclass>
+
<fieldsynopsis><type>string</type><varname>host_info</varname></fieldsynopsis>
+ </classsynopsis>
+ <para>&style.procedural;</para>
+ <methodsynopsis>
+ <type>string</type><methodname>mysqli_get_host_info</methodname>
+
<methodparam><type>mysqli</type><parameter>link</parameter></methodparam>
+ </methodsynopsis>
+ <para>
+ Returns a string describing the connection represented by
+ the <parameter>link</parameter> parameter (including
+ the server host name).
+ </para>
+ </refsect1>
+
+ <refsect1 role="parameters">
+ &reftitle.parameters;
+ <para>
+ <variablelist>
+ &mysqli.link.description;
+ </variablelist>
+ </para>
+ </refsect1>
+
+ <refsect1 role="returnvalues">
+ &reftitle.returnvalues;
+ <para>
+ A character string representing the server hostname and the connection
type.
+ </para>
+ </refsect1>
+
+ <refsect1 role="examples">
+ &reftitle.examples;
+ <example>
+ <title><varname>mysqli->host_info</varname> example</title>
+ <para>&style.oop;</para>
+ <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();
+}
+
+/* print host information */
+printf("Host info: %s\n", $mysqli->host_info);
+
+/* close connection */
+$mysqli->close();
+?>
+]]>
+ </programlisting>
+ <para>&style.procedural;</para>
+ <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();
+}
+
+/* print host information */
+printf("Host info: %s\n", mysqli_get_host_info($link));
+
+/* close connection */
+mysqli_close($link);
+?>
+]]>
+ </programlisting>
+ &examples.outputs;
+ <screen>
+<![CDATA[
+Host info: Localhost via UNIX socket
+]]>
+ </screen>
+ </example>
+ </refsect1>
+
+ <refsect1 role="seealso">
+ &reftitle.seealso;
+ <para>
+ <simplelist>
+ <member><function>mysqli_get_proto_info</function></member>
+ </simplelist>
+ </para>
+ </refsect1>
+
+</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:"~/.phpdoc/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
+-->
=======================================
--- /dev/null
+++ /trunk/xml/reference/mysqli/mysqli/get-proto-info.xml Sun Aug 14
01:16:33 2011
@@ -0,0 +1,127 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!-- $Revision: 299196 $ -->
+<refentry xml:id="mysqli.get-proto-info"
xmlns="http://docbook.org/ns/docbook">
+ <refnamediv>
+ <refname>mysqli->protocol_version</refname>
+ <refname>mysqli_get_proto_info</refname>
+ <refpurpose>Returns the version of the MySQL protocol used</refpurpose>
+ </refnamediv>
+
+ <refsect1 role="description">
+ &reftitle.description;
+ <para>&style.oop;</para>
+ <classsynopsis>
+ <ooclass><classname>mysqli</classname></ooclass>
+
<fieldsynopsis><type>string</type><varname>protocol_version</varname></fieldsynopsis>
+ </classsynopsis>
+ <para>&style.procedural;</para>
+ <methodsynopsis>
+ <type>int</type><methodname>mysqli_get_proto_info</methodname>
+
<methodparam><type>mysqli</type><parameter>link</parameter></methodparam>
+ </methodsynopsis>
+ <para>
+ Returns an integer representing the MySQL protocol version used by the
+ connection represented by the <parameter>link</parameter> parameter.
+ </para>
+ </refsect1>
+
+ <refsect1 role="parameters">
+ &reftitle.parameters;
+ <para>
+ <variablelist>
+ &mysqli.link.description;
+ </variablelist>
+ </para>
+ </refsect1>
+
+ <refsect1 role="returnvalues">
+ &reftitle.returnvalues;
+ <para>
+ Returns an integer representing the protocol version.
+ </para>
+ </refsect1>
+
+ <refsect1 role="examples">
+ &reftitle.examples;
+ <example>
+ <title><varname>mysqli->protocol_version</varname> example</title>
+ <para>&style.oop;</para>
+ <programlisting role="php">
+<![CDATA[
+<?php
+$mysqli = new mysqli("localhost", "my_user", "my_password");
+
+/* check connection */
+if (mysqli_connect_errno()) {
+ printf("Connect failed: %s\n", mysqli_connect_error());
+ exit();
+}
+
+/* print protocol version */
+printf("Protocol version: %d\n", $mysqli->protocol_version);
+
+/* close connection */
+$mysqli->close();
+?>
+]]>
+ </programlisting>
+ <para>&style.procedural;</para>
+ <programlisting role="php">
+<![CDATA[
+<?php
+$link = mysqli_connect("localhost", "my_user", "my_password");
+
+/* check connection */
+if (mysqli_connect_errno()) {
+ printf("Connect failed: %s\n", mysqli_connect_error());
+ exit();
+}
+
+/* print protocol version */
+printf("Protocol version: %d\n", mysqli_get_proto_info($link));
+
+/* close connection */
+mysqli_close($link);
+?>
+]]>
+ </programlisting>
+ &examples.outputs;
+ <screen>
+<![CDATA[
+Protocol version: 10
+]]>
+ </screen>
+ </example>
+ </refsect1>
+
+ <refsect1 role="seealso">
+ &reftitle.seealso;
+ <para>
+ <simplelist>
+ <member><function>mysqli_get_host_info</function></member>
+ </simplelist>
+ </para>
+ </refsect1>
+
+</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:"~/.phpdoc/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
+-->
=======================================
--- /dev/null
+++ /trunk/xml/reference/mysqli/mysqli/get-server-info.xml Sun Aug 14
01:16:33 2011
@@ -0,0 +1,129 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!-- $Revision: 299196 $ -->
+<refentry xml:id="mysqli.get-server-info"
xmlns="http://docbook.org/ns/docbook">
+ <refnamediv>
+ <refname>mysqli->server_info</refname>
+ <refname>mysqli_get_server_info</refname>
+ <refpurpose>Returns the version of the MySQL server</refpurpose>
+ </refnamediv>
+
+ <refsect1 role="description">
+ &reftitle.description;
+ <para>&style.oop;</para>
+ <classsynopsis>
+ <ooclass><classname>mysqli</classname></ooclass>
+
<fieldsynopsis><type>string</type><varname>server_info</varname></fieldsynopsis>
+ </classsynopsis>
+ <para>&style.procedural;</para>
+ <methodsynopsis>
+ <type>string</type><methodname>mysqli_get_server_info</methodname>
+
<methodparam><type>mysqli</type><parameter>link</parameter></methodparam>
+ </methodsynopsis>
+ <para>
+ Returns a string representing the version of the MySQL server that the
+ MySQLi extension is connected to.
+ </para>
+ </refsect1>
+
+ <refsect1 role="parameters">
+ &reftitle.parameters;
+ <para>
+ <variablelist>
+ &mysqli.link.description;
+ </variablelist>
+ </para>
+ </refsect1>
+
+ <refsect1 role="returnvalues">
+ &reftitle.returnvalues;
+ <para>
+ A character string representing the server version.
+ </para>
+ </refsect1>
+
+ <refsect1 role="examples">
+ &reftitle.examples;
+ <example>
+ <title><varname>mysqli->server_info</varname> example</title>
+ <para>&style.oop;</para>
+ <programlisting role="php">
+<![CDATA[
+<?php
+$mysqli = new mysqli("localhost", "my_user", "my_password");
+
+/* check connection */
+if (mysqli_connect_errno()) {
+ printf("Connect failed: %s\n", mysqli_connect_error());
+ exit();
+}
+
+/* print server version */
+printf("Server version: %s\n", $mysqli->server_info);
+
+/* close connection */
+$mysqli->close();
+?>
+]]>
+ </programlisting>
+ <para>&style.procedural;</para>
+ <programlisting role="php">
+<![CDATA[
+<?php
+$link = mysqli_connect("localhost", "my_user", "my_password");
+
+/* check connection */
+if (mysqli_connect_errno()) {
+ printf("Connect failed: %s\n", mysqli_connect_error());
+ exit();
+}
+
+/* print server version */
+printf("Server version: %s\n", mysqli_get_server_info($link));
+
+/* close connection */
+mysqli_close($link);
+?>
+]]>
+ </programlisting>
+ &examples.outputs;
+ <screen>
+<![CDATA[
+Server version: 4.1.2-alpha-debug
+]]>
+ </screen>
+ </example>
+ </refsect1>
+
+ <refsect1 role="seealso">
+ &reftitle.seealso;
+ <para>
+ <simplelist>
+ <member><function>mysqli_get_client_info</function></member>
+ <member><function>mysqli_get_client_version</function></member>
+ <member><function>mysqli_get_server_version</function></member>
+ </simplelist>
+ </para>
+ </refsect1>
+
+</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:"~/.phpdoc/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
+-->
=======================================
--- /dev/null
+++ /trunk/xml/reference/mysqli/mysqli/get-server-version.xml Sun Aug 14
01:16:33 2011
@@ -0,0 +1,135 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!-- $Revision: 299196 $ -->
+<refentry xml:id="mysqli.get-server-version"
xmlns="http://docbook.org/ns/docbook">
+ <refnamediv>
+ <refname>mysqli->server_version</refname>
+ <refname>mysqli_get_server_version</refname>
+ <refpurpose>Returns the version of the MySQL server as an
integer</refpurpose>
+ </refnamediv>
+
+ <refsect1 role="description">
+ &reftitle.description;
+ <para>&style.oop;</para>
+ <classsynopsis>
+ <ooclass><classname>mysqli</classname></ooclass>
+
<fieldsynopsis><type>int</type><varname>server_version</varname></fieldsynopsis>
+ </classsynopsis>
+ <para>&style.procedural;</para>
+ <methodsynopsis>
+ <type>int</type><methodname>mysqli_get_server_version</methodname>
+
<methodparam><type>mysqli</type><parameter>link</parameter></methodparam>
+ </methodsynopsis>
+ <para>
+ The <function>mysqli_get_server_version</function> function returns the
+ version of the server connected to (represented by the
+ <parameter>link</parameter> parameter) as an integer.
+ </para>
+ </refsect1>
+
+ <refsect1 role="parameters">
+ &reftitle.parameters;
+ <para>
+ <variablelist>
+ &mysqli.link.description;
+ </variablelist>
+ </para>
+ </refsect1>
+
+ <refsect1 role="returnvalues">
+ &reftitle.returnvalues;
+ <para>
+ An integer representing the server version.
+ </para>
+ <para>
+ The form of this version number is
+ <literal>main_version * 10000 + minor_version * 100 +
sub_version</literal>
+ (i.e. version 4.1.0 is 40100).
+ </para>
+ </refsect1>
+
+ <refsect1 role="examples">
+ &reftitle.examples;
+ <example>
+ <title><varname>mysqli->server_version</varname> example</title>
+ <para>&style.oop;</para>
+ <programlisting role="php">
+<![CDATA[
+<?php
+$mysqli = new mysqli("localhost", "my_user", "my_password");
+
+/* check connection */
+if (mysqli_connect_errno()) {
+ printf("Connect failed: %s\n", mysqli_connect_error());
+ exit();
+}
+
+/* print server version */
+printf("Server version: %d\n", $mysqli->server_version);
+
+/* close connection */
+$mysqli->close();
+?>
+]]>
+ </programlisting>
+ <para>&style.procedural;</para>
+ <programlisting role="php">
+<![CDATA[
+<?php
+$link = mysqli_connect("localhost", "my_user", "my_password");
+
+/* check connection */
+if (mysqli_connect_errno()) {
+ printf("Connect failed: %s\n", mysqli_connect_error());
+ exit();
+}
+
+/* print server version */
+printf("Server version: %d\n", mysqli_get_server_version($link));
+
+/* close connection */
+mysqli_close($link);
+?>
+]]>
+ </programlisting>
+ &examples.outputs;
+ <screen>
+<![CDATA[
+Server version: 40102
+]]>
+ </screen>
+ </example>
+ </refsect1>
+
+ <refsect1 role="seealso">
+ &reftitle.seealso;
+ <para>
+ <simplelist>
+ <member><function>mysqli_get_client_info</function></member>
+ <member><function>mysqli_get_client_version</function></member>
+ <member><function>mysqli_get_server_info</function></member>
+ </simplelist>
+ </para>
+ </refsect1>
+
+</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:"~/.phpdoc/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
+-->
=======================================
--- /dev/null
+++ /trunk/xml/reference/mysqli/mysqli/get-warnings.xml Sun Aug 14 01:16:33
2011
@@ -0,0 +1,47 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!-- $Revision: 299472 $ -->
+<refentry xml:id="mysqli.get-warnings"
xmlns="http://docbook.org/ns/docbook">
+ <refnamediv>
+ <refname>mysqli::get_warnings</refname>
+ <refname>mysqli_get_warnings</refname>
+ <refpurpose>Get result of SHOW WARNINGS</refpurpose>
+ </refnamediv>
+
+ <refsect1 role="description">
+ &reftitle.description;
+ <para>&style.oop;</para>
+ <methodsynopsis>
+ <type>mysqli_warning</type><methodname>mysqli::get_warnings</methodname>
+ <void />
+ </methodsynopsis>
+ <para>&style.procedural;</para>
+ <methodsynopsis>
+ <type>mysqli_warning</type><methodname>mysqli_get_warnings</methodname>
+
<methodparam><type>mysqli</type><parameter>link</parameter></methodparam>
+ </methodsynopsis>
+
+ &warn.undocumented.func;
+ </refsect1>
+
+</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:"~/.phpdoc/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
+-->
=======================================
--- /dev/null
+++ /trunk/xml/reference/mysqli/mysqli/info.xml Sun Aug 14 01:16:33 2011
@@ -0,0 +1,177 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!-- $Revision: 300509 $ -->
+<refentry xml:id="mysqli.info" xmlns="http://docbook.org/ns/docbook">
+ <refnamediv>
+ <refname>mysqli->info</refname>
+ <refname>mysqli_info</refname>
+ <refpurpose>Retrieves information about the most recently executed
query</refpurpose>
+ </refnamediv>
+
+ <refsect1 role="description">
+ &reftitle.description;
+ <para>&style.oop;</para>
+ <classsynopsis>
+ <ooclass><classname>mysqli</classname></ooclass>
+
<fieldsynopsis><type>string</type><varname>info</varname></fieldsynopsis>
+ </classsynopsis>
+ <para>&style.procedural;</para>
+ <methodsynopsis>
+ <type>string</type><methodname>mysqli_info</methodname>
+
<methodparam><type>mysqli</type><parameter>link</parameter></methodparam>
+ </methodsynopsis>
+ <para>
+ The <function>mysqli_info</function> function returns a string providing
+ information about the last query executed. The nature of this string is
+ provided below:
+ </para>
+ <para>
+ <table>
+ <title>Possible mysqli_info return values</title>
+ <tgroup cols='2'>
+ <thead>
+ <row>
+ <entry>Query type</entry>
+ <entry>Example result string</entry>
+ </row>
+ </thead>
+ <tbody>
+ <row>
+ <entry>INSERT INTO...SELECT...</entry>
+ <entry>Records: 100 Duplicates: 0 Warnings: 0</entry>
+ </row>
+ <row>
+ <entry>INSERT INTO...VALUES (...),(...),(...)</entry>
+ <entry>Records: 3 Duplicates: 0 Warnings: 0</entry>
+ </row>
+ <row>
+ <entry>LOAD DATA INFILE ...</entry>
+ <entry>Records: 1 Deleted: 0 Skipped: 0 Warnings: 0</entry>
+ </row>
+ <row>
+ <entry>ALTER TABLE ...</entry>
+ <entry>Records: 3 Duplicates: 0 Warnings: 0</entry>
+ </row>
+ <row>
+ <entry>UPDATE ...</entry>
+ <entry>Rows matched: 40 Changed: 40 Warnings: 0</entry>
+ </row>
+ </tbody>
+ </tgroup>
+ </table>
+ </para>
+ <note>
+ <para>
+ Queries which do not fall into one of the preceding formats are not
supported.
+ In these situations, <function>mysqli_info</function> will return an
empty string.
+ </para>
+ </note>
+ </refsect1>
+
+ <refsect1 role="parameters">
+ &reftitle.parameters;
+ <para>
+ <variablelist>
+ &mysqli.link.description;
+ </variablelist>
+ </para>
+ </refsect1>
+
+ <refsect1 role="returnvalues">
+ &reftitle.returnvalues;
+ <para>
+ A character string representing additional information about the most
recently executed query.
+ </para>
+ </refsect1>
+
+ <refsect1 role="examples">
+ &reftitle.examples;
+ <example>
+ <title><varname>mysqli->info</varname> example</title>
+ <para>&style.oop;</para>
+ <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();
+}
+
+$mysqli->query("CREATE TEMPORARY TABLE t1 LIKE City");
+
+/* INSERT INTO .. SELECT */
+$mysqli->query("INSERT INTO t1 SELECT * FROM City ORDER BY ID LIMIT 150");
+printf("%s\n", $mysqli->info);
+
+/* close connection */
+$mysqli->close();
+?>
+]]>
+ </programlisting>
+ <para>&style.procedural;</para>
+ <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();
+}
+
+mysqli_query($link, "CREATE TEMPORARY TABLE t1 LIKE City");
+
+/* INSERT INTO .. SELECT */
+mysqli_query($link, "INSERT INTO t1 SELECT * FROM City ORDER BY ID LIMIT
150");
+printf("%s\n", mysqli_info($link));
+
+/* close connection */
+mysqli_close($link);
+?>
+]]>
+ </programlisting>
+ &examples.outputs;
+ <screen>
+<![CDATA[
+Records: 150 Duplicates: 0 Warnings: 0
+]]>
+ </screen>
+ </example>
+ </refsect1>
+
+ <refsect1 role="seealso">
+ &reftitle.seealso;
+ <para>
+ <simplelist>
+ <member><function>mysqli_affected_rows</function></member>
+ <member><function>mysqli_warning_count</function></member>
+ <member><function>mysqli_num_rows</function></member>
+ </simplelist>
+ </para>
+ </refsect1>
+
+</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:"~/.phpdoc/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
+-->
=======================================
--- /dev/null
+++ /trunk/xml/reference/mysqli/mysqli/init.xml Sun Aug 14 01:16:33 2011
@@ -0,0 +1,81 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!-- $Revision: 299158 $ -->
+<refentry xml:id="mysqli.init" xmlns="http://docbook.org/ns/docbook">
+ <refnamediv>
+ <refname>mysqli::init</refname>
+ <refname>mysqli_init</refname>
+ <refpurpose>Initializes MySQLi and returns a resource for use with
mysqli_real_connect()</refpurpose>
+ </refnamediv>
+
+ <refsect1 role="description">
+ &reftitle.description;
+ <para>&style.oop;</para>
+ <methodsynopsis>
+ <type>mysqli</type><methodname>mysqli::init</methodname>
+ <void/>
+ </methodsynopsis>
+ <para>&style.procedural;</para>
+ <methodsynopsis>
+ <type>mysqli</type><methodname>mysqli_init</methodname>
+ <void/>
+ </methodsynopsis>
+ <para>
+ Allocates or initializes a MYSQL object suitable for
+ <function>mysqli_options</function> and
<function>mysqli_real_connect</function>.
+ </para>
+ <note>
+ <para>
+ Any subsequent calls to any mysqli function (except
<function>mysqli_options</function>)
+ will fail until <function>mysqli_real_connect</function> was called.
+ </para>
+ </note>
+ </refsect1>
+
+ <refsect1 role="returnvalues">
+ &reftitle.returnvalues;
+ <para>
+ Returns an object.
+ </para>
+ </refsect1>
+
+ <refsect1 role="examples">
+ &reftitle.examples;
+ <para>
+ See <function>mysqli_real_connect</function>.
+ </para>
+ </refsect1>
+
+ <refsect1 role="seealso">
+ &reftitle.seealso;
+ <para>
+ <simplelist>
+ <member><function>mysqli_options</function></member>
+ <member><function>mysqli_close</function></member>
+ <member><function>mysqli_real_connect</function></member>
+ <member><function>mysqli_connect</function></member>
+ </simplelist>
+ </para>
+ </refsect1>
+
+</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:"~/.phpdoc/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
+-->
=======================================
--- /dev/null
+++ /trunk/xml/reference/mysqli/mysqli/insert-id.xml Sun Aug 14 01:16:33
2011
@@ -0,0 +1,151 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!-- $Revision: 299196 $ -->
+<refentry xml:id="mysqli.insert-id" xmlns="http://docbook.org/ns/docbook">
+ <refnamediv>
+ <refname>mysqli->insert_id</refname>
+ <refname>mysqli_insert_id</refname>
+ <refpurpose>Returns the auto generated id used in the last
query</refpurpose>
+ </refnamediv>
+
+ <refsect1 role="description">
+ &reftitle.description;
+ <para>&style.oop;</para>
+ <classsynopsis>
+ <ooclass><classname>mysqli</classname></ooclass>
+
<fieldsynopsis><type>mixed</type><varname>insert_id</varname></fieldsynopsis>
+ </classsynopsis>
+ <para>&style.procedural;</para>
+ <methodsynopsis>
+ <type>mixed</type><methodname>mysqli_insert_id</methodname>
+
<methodparam><type>mysqli</type><parameter>link</parameter></methodparam>
+ </methodsynopsis>
+ <para>
+ The <function>mysqli_insert_id</function> function returns the ID
generated
+ by a query on a table with a column having the AUTO_INCREMENT
attribute. If
+ the last query wasn't an INSERT or UPDATE statement or if the modified
table
+ does not have a column with the AUTO_INCREMENT attribute, this function
will
+ return zero.
+ </para>
+ <note>
+ <para>
+ Performing an INSERT or UPDATE statement using the LAST_INSERT_ID()
+ function will also modify the value returned by the
+ <function>mysqli_insert_id</function> function.
+ </para>
+ </note>
+ </refsect1>
+
+ <refsect1 role="parameters">
+ &reftitle.parameters;
+ <para>
+ <variablelist>
+ &mysqli.link.description;
+ </variablelist>
+ </para>
+ </refsect1>
+
+ <refsect1 role="returnvalues">
+ &reftitle.returnvalues;
+ <para>
+ The value of the <literal>AUTO_INCREMENT</literal> field that was
updated
+ by the previous query. Returns zero if there was no previous query on
the
+ connection or if the query did not update an
<literal>AUTO_INCREMENT</literal>
+ value.
+ </para>
+ <note>
+ <para>
+ If the number is greater than maximal int value,
<function>mysqli_insert_id</function>
+ will return a string.
+ </para>
+ </note>
+ </refsect1>
+
+ <refsect1 role="examples">
+ &reftitle.examples;
+ <example>
+ <title><varname>mysqli->insert_id</varname> example</title>
+ <para>&style.oop;</para>
+ <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();
+}
+
+$mysqli->query("CREATE TABLE myCity LIKE City");
+
+$query = "INSERT INTO myCity VALUES
(NULL, 'Stuttgart', 'DEU', 'Stuttgart', 617000)";
+$mysqli->query($query);
+
+printf ("New Record has id %d.\n", $mysqli->insert_id);
+
+/* drop table */
+$mysqli->query("DROP TABLE myCity");
+
+/* close connection */
+$mysqli->close();
+?>
+]]>
+ </programlisting>
+ <para>&style.procedural;</para>
+ <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();
+}
+
+mysqli_query($link, "CREATE TABLE myCity LIKE City");
+
+$query = "INSERT INTO myCity VALUES
(NULL, 'Stuttgart', 'DEU', 'Stuttgart', 617000)";
+mysqli_query($link, $query);
+
+printf ("New Record has id %d.\n", mysqli_insert_id($link));
+
+/* drop table */
+mysqli_query($link, "DROP TABLE myCity");
+
+/* close connection */
+mysqli_close($link);
+?>
+]]>
+ </programlisting>
+ &examples.outputs;
+ <screen>
+<![CDATA[
+New Record has id 1.
+]]>
+ </screen>
+ </example>
+ </refsect1>
+
+</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:"~/.phpdoc/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
+-->
=======================================
--- /dev/null
+++ /trunk/xml/reference/mysqli/mysqli/kill.xml Sun Aug 14 01:16:33 2011
@@ -0,0 +1,172 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!-- $Revision: 299196 $ -->
+<refentry xml:id="mysqli.kill" xmlns="http://docbook.org/ns/docbook">
+ <refnamediv>
+ <refname>mysqli::kill</refname>
+ <refname>mysqli_kill</refname>
+ <refpurpose>Asks the server to kill a MySQL thread</refpurpose>
+ </refnamediv>
+
+ <refsect1 role="description">
+ &reftitle.description;
+ <para>&style.oop;</para>
+ <methodsynopsis>
+ <type>bool</type><methodname>mysqli::kill</methodname>
+
<methodparam><type>int</type><parameter>processid</parameter></methodparam>
+ </methodsynopsis>
+ <para>&style.procedural;</para>
+ <methodsynopsis>
+ <type>bool</type><methodname>mysqli_kill</methodname>
+
<methodparam><type>mysqli</type><parameter>link</parameter></methodparam>
+
<methodparam><type>int</type><parameter>processid</parameter></methodparam>
+ </methodsynopsis>
+ <para>
+ This function is used to ask the server to kill a MySQL thread specified
+ by the <parameter>processid</parameter> parameter. This value must be
+ retrieved by calling the <function>mysqli_thread_id</function> function.
+ </para>
+ <para>
+ To stop a running query you should use the SQL command
+ <literal>KILL QUERY processid</literal>.
+ </para>
+ </refsect1>
+
+ <refsect1 role="parameters">
+ &reftitle.parameters;
+ <para>
+ <variablelist>
+ &mysqli.link.description;
+ </variablelist>
+ </para>
+ </refsect1>
+
+ <refsect1 role="returnvalues">
+ &reftitle.returnvalues;
+ <para>
+ &return.success;
+ </para>
+ </refsect1>
+
+ <refsect1 role="examples">
+ &reftitle.examples;
+ <example>
+ <title><methodname>mysqli::kill</methodname> example</title>
+ <para>&style.oop;</para>
+ <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>
+ <para>&style.procedural;</para>
+ <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>
+ &examples.outputs;
+ <screen>
+<![CDATA[
+Error: MySQL server has gone away
+]]>
+ </screen>
+ </example>
+ </refsect1>
+
+ <refsect1 role="seealso">
+ &reftitle.seealso;
+ <para>
+ <simplelist>
+ <member><function>mysqli_thread_id</function></member>
+ </simplelist>
+ </para>
+ </refsect1>
+
+</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:"~/.phpdoc/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
+-->
+
+<!-- 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:"~/.phpdoc/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
+-->
=======================================
--- /dev/null
+++ /trunk/xml/reference/mysqli/mysqli/more-results.xml Sun Aug 14 01:16:33
2011
@@ -0,0 +1,82 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!-- $Revision: 299158 $ -->
+<refentry xml:id="mysqli.more-results"
xmlns="http://docbook.org/ns/docbook">
+ <refnamediv>
+ <refname>mysqli::more_results</refname>
+ <refname>mysqli_more_results</refname>
+ <refpurpose>Check if there are any more query results from a multi
query</refpurpose>
+ </refnamediv>
+
+ <refsect1 role="description">
+ &reftitle.description;
+ <para>&style.oop;</para>
+ <methodsynopsis>
+ <type>bool</type><methodname>mysqli::more_results</methodname>
+ <void />
+ </methodsynopsis>
+ <para>&style.procedural;</para>
+ <methodsynopsis>
+ <type>bool</type><methodname>mysqli_more_results</methodname>
+
<methodparam><type>mysqli</type><parameter>link</parameter></methodparam>
+ </methodsynopsis>
+ <para>
+ Indicates if one or more result sets are available from a previous call
to
+ <function>mysqli_multi_query</function>.
+ </para>
+ </refsect1>
+
+ <refsect1 role="parameters">
+ &reftitle.parameters;
+ <para>
+ <variablelist>
+ &mysqli.link.description;
+ </variablelist>
+ </para>
+ </refsect1>
+
+ <refsect1 role="returnvalues">
+ &reftitle.returnvalues;
+ <para>
+ &return.success;
+ </para>
+ </refsect1>
+
+ <refsect1 role="examples">
+ &reftitle.examples;
+ <para>See <function>mysqli_multi_query</function>.</para>
+ </refsect1>
+
+ <refsect1 role="seealso">
+ &reftitle.seealso;
+ <para>
+ <simplelist>
+ <member><function>mysqli_multi_query</function></member>
+ <member><function>mysqli_next_result</function></member>
+ <member><function>mysqli_store_result</function></member>
+ <member><function>mysqli_use_result</function></member>
+ </simplelist>
+ </para>
+ </refsect1>
+
+</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:"~/.phpdoc/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
+-->
=======================================
--- /dev/null
+++ /trunk/xml/reference/mysqli/mysqli/multi-query.xml Sun Aug 14 01:16:33
2011
@@ -0,0 +1,190 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!-- $Revision: 299196 $ -->
+<refentry xml:id="mysqli.multi-query"
xmlns="http://docbook.org/ns/docbook">
+ <refnamediv>
+ <refname>mysqli::multi_query</refname>
+ <refname>mysqli_multi_query</refname>
+ <refpurpose>Performs a query on the database</refpurpose>
+ </refnamediv>
+
+ <refsect1 role="description">
+ &reftitle.description;
+ <para>&style.oop;</para>
+ <methodsynopsis>
+ <type>bool</type><methodname>mysqli::multi_query</methodname>
+
<methodparam><type>string</type><parameter>query</parameter></methodparam>
+ </methodsynopsis>
+ <para>&style.procedural;</para>
+ <methodsynopsis>
+ <type>bool</type><methodname>mysqli_multi_query</methodname>
+
<methodparam><type>mysqli</type><parameter>link</parameter></methodparam>
+
<methodparam><type>string</type><parameter>query</parameter></methodparam>
+ </methodsynopsis>
+ <para>
+ Executes one or multiple queries which are concatenated by a semicolon.
+ </para>
+ <para>
+ To retrieve the resultset from the first query you can use
+ <function>mysqli_use_result</function> or
<function>mysqli_store_result</function>.
+ All subsequent query results can be processed using
+ <function>mysqli_more_results</function> and
<function>mysqli_next_result</function>.
+ </para>
+ </refsect1>
+
+ <refsect1 role="parameters">
+ &reftitle.parameters;
+ <para>
+ <variablelist>
+ &mysqli.link.description;
+ <varlistentry>
+ <term><parameter>query</parameter></term>
+ <listitem>
+ <para>
+ The query, as a string.
+ </para>
+ <para>
+ Data inside the query should be <link
+ linkend="mysqli.real-escape-string">properly escaped</link>.
+ </para>
+ </listitem>
+ </varlistentry>
+ </variablelist>
+ </para>
+ </refsect1>
+
+ <refsect1 role="returnvalues">
+ &reftitle.returnvalues;
+ <para>
+ Returns &false; if the first statement failed.
+ To retrieve subsequent errors from other statements you have to call
+ <function>mysqli_next_result</function> first.
+ </para>
+ </refsect1>
+
+ <refsect1 role="examples">
+ &reftitle.examples;
+ <example>
+ <title><methodname>mysqli::multi_query</methodname> example</title>
+ <para>&style.oop;</para>
+ <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();
+}
+
+$query = "SELECT CURRENT_USER();";
+$query .= "SELECT Name FROM City ORDER BY ID LIMIT 20, 5";
+
+/* execute multi query */
+if ($mysqli->multi_query($query)) {
+ do {
+ /* store first result set */
+ if ($result = $mysqli->store_result()) {
+ while ($row = $result->fetch_row()) {
+ printf("%s\n", $row[0]);
+ }
+ $result->free();
+ }
+ /* print divider */
+ if ($mysqli->more_results()) {
+ printf("-----------------\n");
+ }
+ } while ($mysqli->next_result());
+}
+
+/* close connection */
+$mysqli->close();
+?>
+]]>
+ </programlisting>
+ <para>&style.procedural;</para>
+ <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();
+}
+
+$query = "SELECT CURRENT_USER();";
+$query .= "SELECT Name FROM City ORDER BY ID LIMIT 20, 5";
+
+/* execute multi query */
+if (mysqli_multi_query($link, $query)) {
+ do {
+ /* store first result set */
+ if ($result = mysqli_store_result($link)) {
+ while ($row = mysqli_fetch_row($result)) {
+ printf("%s\n", $row[0]);
+ }
+ mysqli_free_result($result);
+ }
+ /* print divider */
+ if (mysqli_more_results($link)) {
+ printf("-----------------\n");
+ }
+ } while (mysqli_next_result($link));
+}
+
+/* close connection */
+mysqli_close($link);
+?>
+]]>
+ </programlisting>
+ &examples.outputs.similar;
+ <screen>
+<![CDATA[
+my_user@localhost
+-----------------
+Amersfoort
+Maastricht
+Dordrecht
+Leiden
+Haarlemmermeer
+]]>
+ </screen>
+ </example>
+ </refsect1>
+
+ <refsect1 role="seealso">
+ &reftitle.seealso;
+ <para>
+ <simplelist>
+ <member><function>mysqli_use_result</function></member>
+ <member><function>mysqli_store_result</function></member>
+ <member><function>mysqli_next_result</function></member>
+ <member><function>mysqli_more_results</function></member>
+ </simplelist>
+ </para>
+ </refsect1>
+
+</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:"~/.phpdoc/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
+-->
=======================================
--- /dev/null
+++ /trunk/xml/reference/mysqli/mysqli/next-result.xml Sun Aug 14 01:16:33
2011
@@ -0,0 +1,86 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!-- $Revision: 299158 $ -->
+<refentry xml:id="mysqli.next-result"
xmlns="http://docbook.org/ns/docbook">
+ <refnamediv>
+ <refname>mysqli::next_result</refname>
+ <refname>mysqli_next_result</refname>
+ <refpurpose>Prepare next result from multi_query</refpurpose>
+ </refnamediv>
+
+ <refsect1 role="description">
+ &reftitle.description;
+ <para>&style.oop;</para>
+ <methodsynopsis>
+ <type>bool</type><methodname>mysqli::next_result</methodname>
+ <void />
+ </methodsynopsis>
+ <para>&style.procedural;</para>
+ <methodsynopsis>
+ <type>bool</type><methodname>mysqli_next_result</methodname>
+
<methodparam><type>mysqli</type><parameter>link</parameter></methodparam>
+ </methodsynopsis>
+ <para>
+ Prepares next result set from a previous call to
+ <function>mysqli_multi_query</function> which can be retrieved by
+ <function>mysqli_store_result</function> or
+ <function>mysqli_use_result</function>.
+ </para>
+ </refsect1>
+
+ <refsect1 role="parameters">
+ &reftitle.parameters;
+ <para>
+ <variablelist>
+ &mysqli.link.description;
+ </variablelist>
+ </para>
+ </refsect1>
+
+ <refsect1 role="returnvalues">
+ &reftitle.returnvalues;
+ <para>
+ &return.success;
+ </para>
+ </refsect1>
+
+ <refsect1 role="examples">
+ &reftitle.examples;
+ <para>
+ See <function>mysqli_multi_query</function>.
+ </para>
+ </refsect1>
+
+ <refsect1 role="seealso">
+ &reftitle.seealso;
+ <para>
+ <simplelist>
+ <member><function>mysqli_multi_query</function></member>
+ <member><function>mysqli_more_results</function></member>
+ <member><function>mysqli_store_result</function></member>
+ <member><function>mysqli_use_result</function></member>
+ </simplelist>
+ </para>
+ </refsect1>
+
+</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:"~/.phpdoc/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
+-->
=======================================
--- /dev/null
+++ /trunk/xml/reference/mysqli/mysqli/options.xml Sun Aug 14 01:16:33 2011
@@ -0,0 +1,151 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!-- $Revision: 304709 $ -->
+<refentry xml:id="mysqli.options" xmlns="http://docbook.org/ns/docbook">
+ <refnamediv>
+ <refname>mysqli::options</refname>
+ <refname>mysqli_options</refname>
+ <refpurpose>Set options</refpurpose>
+ </refnamediv>
+
+ <refsect1 role="description">
+ &reftitle.description;
+ <para>&style.oop;</para>
+ <methodsynopsis>
+ <type>bool</type><methodname>mysqli::options</methodname>
+ <methodparam><type>int</type><parameter>option</parameter></methodparam>
+
<methodparam><type>mixed</type><parameter>value</parameter></methodparam>
+ </methodsynopsis>
+ <para>&style.procedural;</para>
+ <methodsynopsis>
+ <type>bool</type><methodname>mysqli_options</methodname>
+
<methodparam><type>mysqli</type><parameter>link</parameter></methodparam>
+ <methodparam><type>int</type><parameter>option</parameter></methodparam>
+
<methodparam><type>mixed</type><parameter>value</parameter></methodparam>
+ </methodsynopsis>
+ <para>
+ Used to set extra connect options and affect behavior for a connection.
+ </para>
+ <para>
+ This function may be called multiple times to set several options.
+ </para>
+ <para>
+ <function>mysqli_options</function> should be called after
+ <function>mysqli_init</function> and before
+ <function>mysqli_real_connect</function>.
+ </para>
+ </refsect1>
+
+ <refsect1 role="parameters">
+ &reftitle.parameters;
+ <para>
+ <variablelist>
+ &mysqli.link.description;
+ <varlistentry>
+ <term><parameter>option</parameter></term>
+ <listitem>
+ <para>
+ The option that you want to set. It can be one of the following
values:
+ <table>
+ <title>Valid options</title>
+ <tgroup cols='2'>
+ <thead>
+ <row>
+ <entry>Name</entry>
+ <entry>Description</entry>
+ </row>
+ </thead>
+ <tbody>
+ <row>
+ <entry><constant>MYSQLI_OPT_CONNECT_TIMEOUT</constant></entry>
+ <entry>connection timeout in seconds (supported on Windows with
TCP/IP since PHP 5.3.1)</entry>
+ </row>
+ <row>
+ <entry><constant>MYSQLI_OPT_LOCAL_INFILE</constant></entry>
+ <entry>enable/disable use of <literal>LOAD LOCAL
INFILE</literal></entry>
+ </row>
+ <row>
+ <entry><constant>MYSQLI_INIT_COMMAND</constant></entry>
+ <entry>command to execute after when connecting to MySQL
server</entry>
+ </row>
+ <row>
+ <entry><constant>MYSQLI_READ_DEFAULT_FILE</constant></entry>
+ <entry>
+ Read options from named option file instead of
<filename>my.cnf</filename>
+ </entry>
+ </row>
+ <row>
+ <entry><constant>MYSQLI_READ_DEFAULT_GROUP</constant></entry>
+ <entry>
+ Read options from the named group from
<filename>my.cnf</filename>
+ or the file specified with
<constant>MYSQL_READ_DEFAULT_FILE</constant>.
+ </entry>
+ </row>
+ </tbody>
+ </tgroup>
+ </table>
+ </para>
+ </listitem>
+ </varlistentry>
+ <varlistentry>
+ <term><parameter>value</parameter></term>
+ <listitem>
+ <para>
+ The value for the option.
+ </para>
+ </listitem>
+ </varlistentry>
+ </variablelist>
+ </para>
+ </refsect1>
+
+ <refsect1 role="returnvalues">
+ &reftitle.returnvalues;
+ <para>
+ &return.success;
+ </para>
+ </refsect1>
+
+ <refsect1 role="examples">
+ &reftitle.examples;
+ <para>
+ See <function>mysqli_real_connect</function>.
+ </para>
+ </refsect1>
+
+ <refsect1 role="notes">
+ &reftitle.notes;
+ &mysqli.charset.note;
+ </refsect1>
+
+ <refsect1 role="seealso">
+ &reftitle.seealso;
+ <para>
+ <simplelist>
+ <member><function>mysqli_init</function></member>
+ <member><function>mysqli_real_connect</function></member>
+ </simplelist>
+ </para>
+ </refsect1>
+
+</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:"~/.phpdoc/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
+-->
=======================================
--- /dev/null
+++ /trunk/xml/reference/mysqli/mysqli/ping.xml Sun Aug 14 01:16:33 2011
@@ -0,0 +1,133 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!-- $Revision: 299196 $ -->
+<refentry xml:id="mysqli.ping" xmlns="http://docbook.org/ns/docbook">
+ <refnamediv>
+ <refname>mysqli::ping</refname>
+ <refname>mysqli_ping</refname>
+ <refpurpose>Pings a server connection, or tries to reconnect if the
connection has gone down</refpurpose>
+ </refnamediv>
+
+ <refsect1 role="description">
+ &reftitle.description;
+ <para>&style.oop;</para>
+ <methodsynopsis>
+ <type>bool</type><methodname>mysqli::ping</methodname>
+ <void/>
+ </methodsynopsis>
+ <para>&style.procedural;</para>
+ <methodsynopsis>
+ <type>bool</type><methodname>mysqli_ping</methodname>
+
<methodparam><type>mysqli</type><parameter>link</parameter></methodparam>
+ </methodsynopsis>
+ <para>
+ Checks whether the connection to the server is working. If it has gone
+ down, and global option <link
+ linkend="ini.mysqli.reconnect">mysqli.reconnect</link> is enabled
+ an automatic reconnection is attempted.
+ </para>
+ <para>
+ This function can be used by clients that remain idle for a long while,
+ to check whether the server has closed the connection and reconnect if
+ necessary.
+ </para>
+ </refsect1>
+
+ <refsect1 role="parameters">
+ &reftitle.parameters;
+ <para>
+ <variablelist>
+ &mysqli.link.description;
+ </variablelist>
+ </para>
+ </refsect1>
+
+ <refsect1 role="returnvalues">
+ &reftitle.returnvalues;
+ <para>
+ &return.success;
+ </para>
+ </refsect1>
+
+ <refsect1 role="examples">
+ &reftitle.examples;
+ <example>
+ <title><methodname>mysqli::ping</methodname> example</title>
+ <para>&style.oop;</para>
+ <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();
+}
+
+/* check if server is alive */
+if ($mysqli->ping()) {
+ printf ("Our connection is ok!\n");
+} else {
+ printf ("Error: %s\n", $mysqli->error);
+}
+
+/* close connection */
+$mysqli->close();
+?>
+]]>
+ </programlisting>
+ <para>&style.procedural;</para>
+ <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();
+}
+
+/* check if server is alive */
+if (mysqli_ping($link)) {
+ printf ("Our connection is ok!\n");
+} else {
+ printf ("Error: %s\n", mysqli_error($link));
+}
+
+/* close connection */
+mysqli_close($link);
+?>
+]]>
+ </programlisting>
+ &examples.outputs;
+ <screen>
+<![CDATA[
+Our connection is ok!
+]]>
+ </screen>
+ </example>
+ </refsect1>
+
+</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:"~/.phpdoc/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
+-->
=======================================
--- /dev/null
+++ /trunk/xml/reference/mysqli/mysqli/poll.xml Sun Aug 14 01:16:33 2011
@@ -0,0 +1,164 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!-- $Revision: 304194 $ -->
+<refentry xml:id="mysqli.poll" xmlns="http://docbook.org/ns/docbook"
xmlns:xlink="http://www.w3.org/1999/xlink">
+ <refnamediv>
+ <refname>mysqli::poll</refname>
+ <refname>mysqli_poll</refname>
+ <refpurpose>Poll connections</refpurpose>
+ </refnamediv>
+
+ <refsect1 role="description">
+ &reftitle.description;
+ <para>&style.oop;</para>
+ <methodsynopsis>
+ <modifier>public</modifier>
<type>int</type><methodname>mysqli::poll</methodname>
+ <methodparam><type>array</type><parameter
role="reference">read</parameter></methodparam>
+ <methodparam><type>array</type><parameter
role="reference">error</parameter></methodparam>
+ <methodparam><type>array</type><parameter
role="reference">reject</parameter></methodparam>
+ <methodparam><type>int</type><parameter>sec</parameter></methodparam>
+ <methodparam
choice="opt"><type>int</type><parameter>usec</parameter></methodparam>
+ </methodsynopsis>
+ <para>&style.procedural;</para>
+ <methodsynopsis>
+ <type>int</type><methodname>mysqli_poll</methodname>
+ <methodparam><type>array</type><parameter
role="reference">read</parameter></methodparam>
+ <methodparam><type>array</type><parameter
role="reference">error</parameter></methodparam>
+ <methodparam><type>array</type><parameter
role="reference">reject</parameter></methodparam>
+ <methodparam><type>int</type><parameter>sec</parameter></methodparam>
+ <methodparam
choice="opt"><type>int</type><parameter>usec</parameter></methodparam>
+ </methodsynopsis>
+ &warn.undocumented.func;
+ <para>
+ Poll connections.
+ &mysqli.available.mysqlnd;
+ </para>
+ </refsect1>
+
+ <refsect1 role="parameters">
+ &reftitle.parameters;
+ <para>
+ <variablelist>
+ <varlistentry>
+ <term><parameter>read</parameter></term>
+ <listitem>
+ <para>
+ </para>
+ </listitem>
+ </varlistentry>
+ <varlistentry>
+ <term><parameter>error</parameter></term>
+ <listitem>
+ <para>
+ </para>
+ </listitem>
+ </varlistentry>
+ <varlistentry>
+ <term><parameter>reject</parameter></term>
+ <listitem>
+ <para>
+ </para>
+ </listitem>
+ </varlistentry>
+ <varlistentry>
+ <term><parameter>sec</parameter></term>
+ <listitem>
+ <para>
+ Number of seconds to wait, must be non-negative.
+ </para>
+ </listitem>
+ </varlistentry>
+ <varlistentry>
+ <term><parameter>usec</parameter></term>
+ <listitem>
+ <para>
+ Number of microseconds to wait, must be non-negative.
+ </para>
+ </listitem>
+ </varlistentry>
+ </variablelist>
+ </para>
+ </refsect1>
+
+ <refsect1 role="returnvalues">
+ &reftitle.returnvalues;
+ <para>
+ Returns number of ready connections in success, &false; otherwise.
+ </para>
+ </refsect1>
+
+ <refsect1 role="examples">
+ &reftitle.examples;
+ <para>
+ <example>
+ <title>A <function>mysqli_poll</function> example</title>
+ <programlisting role="php">
+<![CDATA[
+<?php
+$link1 = mysqli_connect();
+$link1->query("SELECT 'test'", MYSQLI_ASYNC);
+$all_links = array($link1);
+$processed = 0;
+do {
+ $links = $errors = $reject = array();
+ foreach ($all_links as $link) {
+ $links[] = $errors[] = $reject[] = $link;
+ }
+ if (!mysqli_poll($links, $errors, $reject, 1)) {
+ continue;
+ }
+ foreach ($links as $link) {
+ if ($result = $link->reap_async_query()) {
+ print_r($result->fetch_row());
+ mysqli_free_result($result);
+ $processed++;
+ }
+ }
+} while ($processed < count($all_links));
+?>
+]]>
+ </programlisting>
+ &example.outputs;
+ <screen>
+<![CDATA[
+Array
+(
+ [0] => test
+)
+]]>
+ </screen>
+ </example>
+ </para>
+ </refsect1>
+
+ <refsect1 role="seealso">
+ &reftitle.seealso;
+ <para>
+ <simplelist>
+ <member><function>mysqli_query</function></member>
+ <member><function>mysqli_reap_async_query</function></member>
+ </simplelist>
+ </para>
+ </refsect1>
+
+</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:"~/.phpdoc/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
+-->
=======================================
--- /dev/null
+++ /trunk/xml/reference/mysqli/mysqli/prepare.xml Sun Aug 14 01:16:33 2011
@@ -0,0 +1,218 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!-- $Revision: 300101 $ -->
+<refentry xml:id="mysqli.prepare" xmlns="http://docbook.org/ns/docbook">
+ <refnamediv>
+ <refname>mysqli::prepare</refname>
+ <refname>mysqli_prepare</refname>
+ <refpurpose>Prepare an SQL statement for execution</refpurpose>
+ </refnamediv>
+
+ <refsect1 role="description">
+ &reftitle.description;
+ <para>&style.oop;</para>
+ <methodsynopsis>
+ <type>mysqli_stmt</type><methodname>mysqli::prepare</methodname>
+
<methodparam><type>string</type><parameter>query</parameter></methodparam>
+ </methodsynopsis>
+ <para>&style.procedural;</para>
+ <methodsynopsis>
+ <type>mysqli_stmt</type><methodname>mysqli_prepare</methodname>
+
<methodparam><type>mysqli</type><parameter>link</parameter></methodparam>
+
<methodparam><type>string</type><parameter>query</parameter></methodparam>
+ </methodsynopsis>
+ <para>
+ Prepares the SQL query, and returns a statement handle to be used for
further
+ operations on the statement. The query must consist of a single SQL
statement.
+ </para>
+ <para>
+ The parameter markers must be bound to application variables using
+ <function>mysqli_stmt_bind_param</function> and/or
+ <function>mysqli_stmt_bind_result</function> before executing the
+ statement or fetching rows.
+ </para>
+ </refsect1>
+
+ <refsect1 role="parameters">
+ &reftitle.parameters;
+ <para>
+ <variablelist>
+ &mysqli.link.description;
+ <varlistentry>
+ <term><parameter>query</parameter></term>
+ <listitem>
+ <para>
+ The query, as a string.
+ </para>
+ <note>
+ <para>
+ You should not add a terminating semicolon or <literal>\g</literal>
+ to the statement.
+ </para>
+ </note>
+ <para>
+ This parameter can include one or more parameter markers in the SQL
+ statement by embedding question mark (<literal>?</literal>)
characters
+ at the appropriate positions.
+ </para>
+ <note>
+ <para>
+ The markers are legal only in certain places in SQL statements.
+ For example, they are allowed in the <literal>VALUES()</literal>
+ list of an <literal>INSERT</literal> statement (to specify column
+ values for a row), or in a comparison with a column in a
+ <literal>WHERE</literal> clause to specify a comparison value.
+ </para>
+ <para>
+ However, they are not allowed for identifiers (such as table or
+ column names), in the select list that names the columns to be
+ returned by a <literal>SELECT</literal> statement, or to specify
both
+ operands of a binary operator such as the <literal>=</literal>
equal
+ sign. The latter restriction is necessary because it would be
+ impossible to determine the parameter type. It's not allowed to
+ compare marker with <literal>NULL</literal> by
+ <literal>? IS NULL</literal> too. In general, parameters are legal
+ only in Data Manipulation Language (DML) statements, and not in
Data
+ Definition Language (DDL) statements.
+ </para>
+ </note>
+ </listitem>
+ </varlistentry>
+ </variablelist>
+ </para>
+ </refsect1>
+
+ <refsect1 role="returnvalues">
+ &reftitle.returnvalues;
+ <para>
+ <function>mysqli_prepare</function> returns a statement object or
&false; if an error occurred.
+ </para>
+ </refsect1>
+
+ <refsect1 role="examples">
+ &reftitle.examples;
+ <example>
+ <title><methodname>mysqli::prepare</methodname> example</title>
+ <para>&style.oop;</para>
+ <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();
+}
+
+$city = "Amersfoort";
+
+/* create a prepared statement */
+if ($stmt = $mysqli->prepare("SELECT District FROM City WHERE Name=?")) {
+
+ /* bind parameters for markers */
+ $stmt->bind_param("s", $city);
+
+ /* execute query */
+ $stmt->execute();
+
+ /* bind result variables */
+ $stmt->bind_result($district);
+
+ /* fetch value */
+ $stmt->fetch();
+
+ printf("%s is in district %s\n", $city, $district);
+
+ /* close statement */
+ $stmt->close();
+}
+
+/* close connection */
+$mysqli->close();
+?>
+]]>
+ </programlisting>
+ <para>&style.procedural;</para>
+ <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();
+}
+
+$city = "Amersfoort";
+
+/* create a prepared statement */
+if ($stmt = mysqli_prepare($link, "SELECT District FROM City WHERE
Name=?")) {
+
+ /* bind parameters for markers */
+ mysqli_stmt_bind_param($stmt, "s", $city);
+
+ /* execute query */
+ mysqli_stmt_execute($stmt);
+
+ /* bind result variables */
+ mysqli_stmt_bind_result($stmt, $district);
+
+ /* fetch value */
+ mysqli_stmt_fetch($stmt);
+
+ printf("%s is in district %s\n", $city, $district);
+
+ /* close statement */
+ mysqli_stmt_close($stmt);
+}
+
+/* close connection */
+mysqli_close($link);
+?>
+]]>
+ </programlisting>
+ &examples.outputs;
+ <screen>
+<![CDATA[
+Amersfoort is in district Utrecht
+]]>
+ </screen>
+ </example>
+ </refsect1>
+
+ <refsect1 role="seealso">
+ &reftitle.seealso;
+ <para>
+ <simplelist>
+ <member><function>mysqli_stmt_execute</function></member>
+ <member><function>mysqli_stmt_fetch</function></member>
+ <member><function>mysqli_stmt_bind_param</function></member>
+ <member><function>mysqli_stmt_bind_result</function></member>
+ <member><function>mysqli_stmt_close</function></member>
+ </simplelist>
+ </para>
+ </refsect1>
+
+</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:"~/.phpdoc/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
+-->
=======================================
--- /dev/null
+++ /trunk/xml/reference/mysqli/mysqli/query.xml Sun Aug 14 01:16:33 2011
@@ -0,0 +1,273 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!-- $Revision: 303318 $ -->
+<refentry xml:id="mysqli.query" xmlns="http://docbook.org/ns/docbook">
+ <refnamediv>
+ <refname>mysqli::query</refname>
+ <refname>mysqli_query</refname>
+ <refpurpose>Performs a query on the database</refpurpose>
+ </refnamediv>
+
+ <refsect1 role="description">
+ &reftitle.description;
+ <para>&style.oop;</para>
+ <methodsynopsis>
+ <type>mixed</type><methodname>mysqli::query</methodname>
+
<methodparam><type>string</type><parameter>query</parameter></methodparam>
+ <methodparam
choice='opt'><type>int</type><parameter>resultmode</parameter></methodparam>
+ </methodsynopsis>
+ <para>&style.procedural;</para>
+ <methodsynopsis>
+ <type>mixed</type><methodname>mysqli_query</methodname>
+
<methodparam><type>mysqli</type><parameter>link</parameter></methodparam>
+
<methodparam><type>string</type><parameter>query</parameter></methodparam>
+ <methodparam
choice='opt'><type>int</type><parameter>resultmode</parameter></methodparam>
+ </methodsynopsis>
+ <para>
+ Performs a <parameter>query</parameter> against the database.
+ </para>
+ <para>
+ Functionally, using this function is identical to calling
+ <function>mysqli_real_query</function> followed either by
+ <function>mysqli_use_result</function> or
+ <function>mysqli_store_result</function>.
+ </para>
+ <note>
+ <para>
+ In the case where you pass a statement to
+ <function>mysqli_query</function> that is longer than
+ <literal>max_allowed_packet</literal> of the server, the returned
+ error codes are different depending on whether you are using MySQL
+ Native Driver (<literal>mysqlnd</literal>) or MySQL Client Library
+ (<literal>libmysql</literal>). The behavior is as follows:
+ </para>
+ <itemizedlist>
+ <listitem>
+ <para>
+ <literal>mysqlnd</literal> on Linux returns an error code of 1153.
+ The error message means <quote>got a packet bigger than
+ <literal>max_allowed_packet</literal> bytes</quote>.
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ <literal>mysqlnd</literal> on Windows returns an error code 2006.
+ This error message means <quote>server has gone away</quote>.
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ <literal>libmysql</literal> on all platforms returns an error code
+ 2006. This error message means <quote>server has gone
+ away</quote>.
+ </para>
+ </listitem>
+ </itemizedlist>
+ </note>
+ </refsect1>
+
+ <refsect1 role="parameters">
+ &reftitle.parameters;
+ <para>
+ <variablelist>
+ &mysqli.link.description;
+ <varlistentry>
+ <term><parameter>query</parameter></term>
+ <listitem>
+ <para>
+ The query string.
+ </para>
+ <para>
+ Data inside the query should be <link
+ linkend="mysqli.real-escape-string">properly escaped</link>.
+ </para>
+ </listitem>
+ </varlistentry>
+ <varlistentry>
+ <term><parameter>resultmode</parameter></term>
+ <listitem>
+ <para>
+ Either the constant <constant>MYSQLI_USE_RESULT</constant> or
+ <constant>MYSQLI_STORE_RESULT</constant> depending on the desired
+ behavior. By default, <constant>MYSQLI_STORE_RESULT</constant> is
used.
+ </para>
+ <para>
+ If you use <constant>MYSQLI_USE_RESULT</constant> all subsequent
calls
+ will return error <literal>Commands out of sync</literal> unless you
+ call <function>mysqli_free_result</function>
+ </para>
+ <para>
+ With <constant>MYSQLI_ASYNC</constant> (available with mysqlnd), it
is
+ possible to perform query asynchronously.
+ <function>mysqli_poll</function> is then used to get results from
such
+ queries.
+ </para>
+ </listitem>
+ </varlistentry>
+ </variablelist>
+ </para>
+ </refsect1>
+
+ <refsect1 role="returnvalues">
+ &reftitle.returnvalues;
+ <para>
+ Returns &false; on failure. For successful <literal>SELECT, SHOW,
DESCRIBE</literal> or
+ <literal>EXPLAIN</literal> queries <function>mysqli_query</function>
will return
+ a result object. For other successful queries
<function>mysqli_query</function> will
+ return &true;.
+ </para>
+ </refsect1>
+
+ <refsect1 role="changelog">
+ &reftitle.changelog;
+ <para>
+ <informaltable>
+ <tgroup cols="2">
+ <thead>
+ <row>
+ <entry>&Version;</entry>
+ <entry>&Description;</entry>
+ </row>
+ </thead>
+ <tbody>
+ <row>
+ <entry>5.3.0</entry>
+ <entry>
+ Added the ability of async queries.
+ </entry>
+ </row>
+ </tbody>
+ </tgroup>
+ </informaltable>
+ </para>
+ </refsect1>
+
+ <refsect1 role="examples">
+ &reftitle.examples;
+ <example>
+ <title><methodname>mysqli::query</methodname> example</title>
+ <para>&style.oop;</para>
+ <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();
+}
+
+/* Create table doesn't return a resultset */
+if ($mysqli->query("CREATE TEMPORARY TABLE myCity LIKE City") === TRUE) {
+ printf("Table myCity successfully created.\n");
+}
+
+/* Select queries return a resultset */
+if ($result = $mysqli->query("SELECT Name FROM City LIMIT 10")) {
+ printf("Select returned %d rows.\n", $result->num_rows);
+
+ /* free result set */
+ $result->close();
+}
+
+/* If we have to retrieve large amount of data we use MYSQLI_USE_RESULT */
+if ($result = $mysqli->query("SELECT * FROM City", MYSQLI_USE_RESULT)) {
+
+ /* Note, that we can't execute any functions which interact with the
+ server until result set was closed. All calls will return an
+ 'out of sync' error */
+ if (!$mysqli->query("SET @a:='this will not work'")) {
+ printf("Error: %s\n", $mysqli->error);
+ }
+ $result->close();
+}
+
+$mysqli->close();
+?>
+]]>
+ </programlisting>
+ <para>&style.procedural;</para>
+ <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();
+}
+
+/* Create table doesn't return a resultset */
+if (mysqli_query($link, "CREATE TEMPORARY TABLE myCity LIKE City") ===
TRUE) {
+ printf("Table myCity successfully created.\n");
+}
+
+/* Select queries return a resultset */
+if ($result = mysqli_query($link, "SELECT Name FROM City LIMIT 10")) {
+ printf("Select returned %d rows.\n", mysqli_num_rows($result));
+
+ /* free result set */
+ mysqli_free_result($result);
+}
+
+/* If we have to retrieve large amount of data we use MYSQLI_USE_RESULT */
+if ($result = mysqli_query($link, "SELECT * FROM City",
MYSQLI_USE_RESULT)) {
+
+ /* Note, that we can't execute any functions which interact with the
+ server until result set was closed. All calls will return an
+ 'out of sync' error */
+ if (!mysqli_query($link, "SET @a:='this will not work'")) {
+ printf("Error: %s\n", mysqli_error($link));
+ }
+ mysqli_free_result($result);
+}
+
+mysqli_close($link);
+?>
+]]>
+ </programlisting>
+ &examples.outputs;
+ <screen>
+<![CDATA[
+Table myCity successfully created.
+Select returned 10 rows.
+Error: Commands out of sync; You can't run this command now
+]]>
+ </screen>
+ </example>
+ </refsect1>
+
+ <refsect1 role="seealso">
+ &reftitle.seealso;
+ <para>
+ <simplelist>
+ <member><function>mysqli_real_query</function></member>
+ <member><function>mysqli_multi_query</function></member>
+ <member><function>mysqli_free_result</function></member>
+ </simplelist>
+ </para>
+ </refsect1>
+
+</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:"~/.phpdoc/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
+-->
=======================================
--- /dev/null
+++ /trunk/xml/reference/mysqli/mysqli/real-connect.xml Sun Aug 14 01:16:33
2011
@@ -0,0 +1,336 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!-- $Revision: 304709 $ -->
+<refentry xml:id="mysqli.real-connect"
xmlns="http://docbook.org/ns/docbook">
+ <refnamediv>
+ <refname>mysqli::real_connect</refname>
+ <refname>mysqli_real_connect</refname>
+ <refpurpose>Opens a connection to a mysql server</refpurpose>
+ </refnamediv>
+
+ <refsect1 role="description">
+ &reftitle.description;
+ <para>&style.oop;</para>
+ <methodsynopsis>
+ <type>bool</type><methodname>mysqli::real_connect</methodname>
+ <methodparam
choice='opt'><type>string</type><parameter>host</parameter></methodparam>
+ <methodparam
choice='opt'><type>string</type><parameter>username</parameter></methodparam>
+ <methodparam
choice='opt'><type>string</type><parameter>passwd</parameter></methodparam>
+ <methodparam
choice='opt'><type>string</type><parameter>dbname</parameter></methodparam>
+ <methodparam
choice='opt'><type>int</type><parameter>port</parameter></methodparam>
+ <methodparam
choice='opt'><type>string</type><parameter>socket</parameter></methodparam>
+ <methodparam
choice='opt'><type>int</type><parameter>flags</parameter></methodparam>
+ </methodsynopsis>
+ <para>&style.procedural;</para>
+ <methodsynopsis>
+ <type>bool</type><methodname>mysqli_real_connect</methodname>
+
<methodparam><type>mysqli</type><parameter>link</parameter></methodparam>
+ <methodparam
choice='opt'><type>string</type><parameter>host</parameter></methodparam>
+ <methodparam
choice='opt'><type>string</type><parameter>username</parameter></methodparam>
+ <methodparam
choice='opt'><type>string</type><parameter>passwd</parameter></methodparam>
+ <methodparam
choice='opt'><type>string</type><parameter>dbname</parameter></methodparam>
+ <methodparam
choice='opt'><type>int</type><parameter>port</parameter></methodparam>
+ <methodparam
choice='opt'><type>string</type><parameter>socket</parameter></methodparam>
+ <methodparam
choice='opt'><type>int</type><parameter>flags</parameter></methodparam>
+ </methodsynopsis>
+ <para>
+ Establish a connection to a MySQL database engine.
+ </para>
+ <para>
+ This function differs from <function>mysqli_connect</function>:
+ </para>
+ <itemizedlist>
+ <listitem>
+ <para>
+ <function>mysqli_real_connect</function> needs a valid object which
has
+ to be created by function <function>mysqli_init</function>.
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ With the <function>mysqli_options</function> function you can set
various
+ options for connection.
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ There is a <parameter>flags</parameter> parameter.
+ </para>
+ </listitem>
+ </itemizedlist>
+ </refsect1>
+
+ <refsect1 role="parameters">
+ &reftitle.parameters;
+ <para>
+ <variablelist>
+ &mysqli.link.description;
+ <varlistentry>
+ <term><parameter>host</parameter></term>
+ <listitem>
+ <para>
+ Can be either a host name or an IP address. Passing the &null; value
+ or the string "localhost" to this parameter, the local host is
+ assumed. When possible, pipes will be used instead of the TCP/IP
+ protocol.
+ </para>
+ </listitem>
+ </varlistentry>
+ <varlistentry>
+ <term><parameter>username</parameter></term>
+ <listitem>
+ <para>
+ The MySQL user name.
+ </para>
+ </listitem>
+ </varlistentry>
+ <varlistentry>
+ <term><parameter>passwd</parameter></term>
+ <listitem>
+ <para>
+ If provided or &null;, the MySQL server will attempt to authenticate
+ the user against those user records which have no password only.
This
+ allows one username to be used with different permissions (depending
+ on if a password as provided or not).
+ </para>
+ </listitem>
+ </varlistentry>
+ <varlistentry>
+ <term><parameter>dbname</parameter></term>
+ <listitem>
+ <para>
+ If provided will specify the default database to be used when
+ performing queries.
+ </para>
+ </listitem>
+ </varlistentry>
+ <varlistentry>
+ <term><parameter>port</parameter></term>
+ <listitem>
+ <para>
+ Specifies the port number to attempt to connect to the MySQL server.
+ </para>
+ </listitem>
+ </varlistentry>
+ <varlistentry>
+ <term><parameter>socket</parameter></term>
+ <listitem>
+ <para>
+ Specifies the socket or named pipe that should be used.
+ </para>
+ <note>
+ <para>
+ Specifying the <parameter>socket</parameter> parameter will not
+ explicitly determine the type of connection to be used when
+ connecting to the MySQL server. How the connection is made to the
+ MySQL database is determined by the <parameter>host</parameter>
+ parameter.
+ </para>
+ </note>
+ </listitem>
+ </varlistentry>
+ <varlistentry>
+ <term><parameter>flags</parameter></term>
+ <listitem>
+ <para>
+ With the parameter <parameter>flags</parameter> you can set
different
+ connection options:
+ </para>
+ <table>
+ <title>Supported flags</title>
+ <tgroup cols='2'>
+ <thead>
+ <row>
+ <entry>Name</entry>
+ <entry>Description</entry>
+ </row>
+ </thead>
+ <tbody>
+ <row>
+ <entry><constant>MYSQLI_CLIENT_COMPRESS</constant></entry>
+ <entry>Use compression protocol</entry>
+ </row>
+ <row>
+ <entry><constant>MYSQLI_CLIENT_FOUND_ROWS</constant></entry>
+ <entry>return number of matched rows, not the number of affected
rows</entry>
+ </row>
+ <row>
+ <entry><constant>MYSQLI_CLIENT_IGNORE_SPACE</constant></entry>
+ <entry>Allow spaces after function names. Makes all function
names reserved words.</entry>
+ </row>
+ <row>
+ <entry><constant>MYSQLI_CLIENT_INTERACTIVE</constant></entry>
+ <entry>
+ Allow <literal>interactive_timeout</literal> seconds (instead of
+ <literal>wait_timeout</literal> seconds) of inactivity before
closing the connection
+ </entry>
+ </row>
+ <row>
+ <entry><constant>MYSQLI_CLIENT_SSL</constant></entry>
+ <entry>Use SSL (encryption)</entry>
+ </row>
+ </tbody>
+ </tgroup>
+ </table>
+ <note>
+ <para>
+ For security reasons the <constant>MULTI_STATEMENT</constant> flag
is
+ not supported in PHP. If you want to execute multiple queries use
the
+ <function>mysqli_multi_query</function> function.
+ </para>
+ </note>
+ </listitem>
+ </varlistentry>
+ </variablelist>
+ </para>
+ </refsect1>
+
+ <refsect1 role="returnvalues">
+ &reftitle.returnvalues;
+ <para>
+ &return.success;
+ </para>
+ </refsect1>
+
+ <refsect1 role="examples">
+ &reftitle.examples;
+ <example>
+ <title><methodname>mysqli::real_connect</methodname> example</title>
+ <para>&style.oop;</para>
+ <programlisting role="php">
+<![CDATA[
+<?php
+
+$mysqli = mysqli_init();
+if (!$mysqli) {
+ die('mysqli_init failed');
+}
+
+if (!$mysqli->options(MYSQLI_INIT_COMMAND, 'SET AUTOCOMMIT = 0')) {
+ die('Setting MYSQLI_INIT_COMMAND failed');
+}
+
+if (!$mysqli->options(MYSQLI_OPT_CONNECT_TIMEOUT, 5)) {
+ die('Setting MYSQLI_OPT_CONNECT_TIMEOUT failed');
+}
+
+if
(!$mysqli->real_connect('localhost', 'my_user', 'my_password', 'my_db')) {
+ die('Connect Error (' . mysqli_connect_errno() . ') '
+ . mysqli_connect_error());
+}
+
+echo 'Success... ' . $mysqli->host_info . "\n";
+
+$mysqli->close();
+?>
+]]>
+ </programlisting>
+ <para>&style.oop; when extending mysqli class</para>
+ <programlisting role="php">
+<![CDATA[
+<?php
+
+class foo_mysqli extends mysqli {
+ public function __construct($host, $user, $pass, $db) {
+ parent::init();
+
+ if (!parent::options(MYSQLI_INIT_COMMAND, 'SET AUTOCOMMIT = 0')) {
+ die('Setting MYSQLI_INIT_COMMAND failed');
+ }
+
+ if (!parent::options(MYSQLI_OPT_CONNECT_TIMEOUT, 5)) {
+ die('Setting MYSQLI_OPT_CONNECT_TIMEOUT failed');
+ }
+
+ if (!parent::real_connect($host, $user, $pass, $db)) {
+ die('Connect Error (' . mysqli_connect_errno() . ') '
+ . mysqli_connect_error());
+ }
+ }
+}
+
+$db = new foo_mysqli('localhost', 'my_user', 'my_password', 'my_db');
+
+echo 'Success... ' . $db->host_info . "\n";
+
+$db->close();
+?>
+]]>
+ </programlisting>
+ <para>&style.procedural;</para>
+ <programlisting role="php">
+<![CDATA[
+<?php
+
+$link = mysqli_init();
+if (!$link) {
+ die('mysqli_init failed');
+}
+
+if (!mysqli_options($link, MYSQLI_INIT_COMMAND, 'SET AUTOCOMMIT = 0')) {
+ die('Setting MYSQLI_INIT_COMMAND failed');
+}
+
+if (!mysqli_options($link, MYSQLI_OPT_CONNECT_TIMEOUT, 5)) {
+ die('Setting MYSQLI_OPT_CONNECT_TIMEOUT failed');
+}
+
+if
(!mysqli_real_connect($link, 'localhost', 'my_user', 'my_password', 'my_db'))
{
+ die('Connect Error (' . mysqli_connect_errno() . ') '
+ . mysqli_connect_error());
+}
+
+echo 'Success... ' . mysqli_get_host_info($link) . "\n";
+
+mysqli_close($link);
+?>
+]]>
+ </programlisting>
+ &examples.outputs;
+ <screen>
+<![CDATA[
+Success... MySQL host info: localhost via TCP/IP
+]]>
+ </screen>
+ </example>
+ </refsect1>
+
+ <refsect1 role="notes">
+ &reftitle.notes;
+ &mysqli.charset.note;
+ </refsect1>
+
+ <refsect1 role="seealso">
+ &reftitle.seealso;
+ <para>
+ <simplelist>
+ <member><function>mysqli_connect</function></member>
+ <member><function>mysqli_init</function></member>
+ <member><function>mysqli_options</function></member>
+ <member><function>mysqli_ssl_set</function></member>
+ <member><function>mysqli_close</function></member>
+ </simplelist>
+ </para>
+ </refsect1>
+
+</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:"~/.phpdoc/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
+-->
=======================================
--- /dev/null
+++ /trunk/xml/reference/mysqli/mysqli/real-escape-string.xml Sun Aug 14
01:16:33 2011
@@ -0,0 +1,170 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!-- $Revision: 300101 $ -->
+<refentry xml:id="mysqli.real-escape-string"
xmlns="http://docbook.org/ns/docbook">
+ <refnamediv>
+ <refname>mysqli::real_escape_string</refname>
+ <refname>mysqli_real_escape_string</refname>
+ <refpurpose>Escapes special characters in a string for use in an SQL
statement, taking into account the current charset of the
connection</refpurpose>
+ </refnamediv>
+
+ <refsect1 role="description">
+ &reftitle.description;
+ <para>&style.oop;</para>
+ <methodsynopsis>
+ <type>string</type><methodname>mysqli::escape_string</methodname>
+
<methodparam><type>string</type><parameter>escapestr</parameter></methodparam>
+ </methodsynopsis>
+ <methodsynopsis>
+ <type>string</type><methodname>mysqli::real_escape_string</methodname>
+
<methodparam><type>string</type><parameter>escapestr</parameter></methodparam>
+ </methodsynopsis>
+ <para>&style.procedural;</para>
+ <methodsynopsis>
+ <type>string</type><methodname>mysqli_real_escape_string</methodname>
+
<methodparam><type>mysqli</type><parameter>link</parameter></methodparam>
+
<methodparam><type>string</type><parameter>escapestr</parameter></methodparam>
+ </methodsynopsis>
+ <para>
+ This function is used to create a legal SQL string that you can use in
an
+ SQL statement. The given string is encoded to an escaped SQL string,
+ taking into account the current character set of the connection.
+ </para>
+ </refsect1>
+
+ <refsect1 role="parameters">
+ &reftitle.parameters;
+ <para>
+ <variablelist>
+ &mysqli.link.description;
+ <varlistentry>
+ <term><parameter>escapestr</parameter></term>
+ <listitem>
+ <para>
+ The string to be escaped.
+ </para>
+ <para>
+ Characters encoded are <literal>NUL (ASCII 0), \n, \r, \, ', ", and
+ Control-Z</literal>.
+ </para>
+ </listitem>
+ </varlistentry>
+ </variablelist>
+ </para>
+ </refsect1>
+
+ <refsect1 role="returnvalues">
+ &reftitle.returnvalues;
+ <para>
+ Returns an escaped string.
+ </para>
+ </refsect1>
+
+ <refsect1 role="examples">
+ &reftitle.examples;
+ <example>
+ <title><methodname>mysqli::real_escape_string</methodname>
example</title>
+ <para>&style.oop;</para>
+ <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();
+}
+
+$mysqli->query("CREATE TEMPORARY TABLE myCity LIKE City");
+
+$city = "'s Hertogenbosch";
+
+/* this query will fail, cause we didn't escape $city */
+if (!$mysqli->query("INSERT into myCity (Name) VALUES ('$city')")) {
+ printf("Error: %s\n", $mysqli->sqlstate);
+}
+
+$city = $mysqli->real_escape_string($city);
+
+/* this query with escaped $city will work */
+if ($mysqli->query("INSERT into myCity (Name) VALUES ('$city')")) {
+ printf("%d Row inserted.\n", $mysqli->affected_rows);
+}
+
+$mysqli->close();
+?>
+]]>
+ </programlisting>
+ <para>&style.procedural;</para>
+ <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();
+}
+
+mysqli_query($link, "CREATE TEMPORARY TABLE myCity LIKE City");
+
+$city = "'s Hertogenbosch";
+
+/* this query will fail, cause we didn't escape $city */
+if (!mysqli_query($link, "INSERT into myCity (Name) VALUES ('$city')")) {
+ printf("Error: %s\n", mysqli_sqlstate($link));
+}
+
+$city = mysqli_real_escape_string($link, $city);
+
+/* this query with escaped $city will work */
+if (mysqli_query($link, "INSERT into myCity (Name) VALUES ('$city')")) {
+ printf("%d Row inserted.\n", mysqli_affected_rows($link));
+}
+
+mysqli_close($link);
+?>
+]]>
+ </programlisting>
+ &examples.outputs;
+ <screen>
+<![CDATA[
+Error: 42000
+1 Row inserted.
+]]>
+ </screen>
+ </example>
+ </refsect1>
+
+ <refsect1 role="seealso">
+ &reftitle.seealso;
+ <para>
+ <simplelist>
+ <member><function>mysqli_character_set_name</function></member>
+ </simplelist>
+ </para>
+ </refsect1>
+
+</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:"~/.phpdoc/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
+-->
=======================================
--- /dev/null
+++ /trunk/xml/reference/mysqli/mysqli/real-query.xml Sun Aug 14 01:16:33
2011
@@ -0,0 +1,93 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!-- $Revision: 299158 $ -->
+<refentry xml:id="mysqli.real-query" xmlns="http://docbook.org/ns/docbook">
+ <refnamediv>
+ <refname>mysqli::real_query</refname>
+ <refname>mysqli_real_query</refname>
+ <refpurpose>执行一个mysql查询</refpurpose>
+ </refnamediv>
+
+ <refsect1 role="description">
+ &reftitle.description;
+ <para>&style.oop;</para>
+ <methodsynopsis>
+ <type>bool</type><methodname>mysqli::real_query</methodname>
+
<methodparam><type>string</type><parameter>query</parameter></methodparam>
+ </methodsynopsis>
+ <para>&style.procedural;</para>
+ <methodsynopsis>
+ <type>bool</type><methodname>mysqli_real_query</methodname>
+
<methodparam><type>mysqli</type><parameter>link</parameter></methodparam>
+
<methodparam><type>string</type><parameter>query</parameter></methodparam>
+ </methodsynopsis>
+ <para>
+ 执行一个单条数据库查询,
+ 其结果可以使用<function>mysqli_store_result</function>或
<function>mysqli_use_result</function>检索或存储.
+ </para>
+ <para>
+ 为了确定给定的查询是否真的返回一个结果集,
+ 可以查看<function>mysqli_field_count</function>.
+ </para>
+ </refsect1>
+
+ <refsect1 role="parameters">
+ &reftitle.parameters;
+ <para>
+ <variablelist>
+ &mysqli.link.description;
+ <varlistentry>
+ <term><parameter>query</parameter></term>
+ <listitem>
+ <para>
+ 查询字符串
+ </para>
+ <para>
+ 查询中的数据可以进行<link
+ linkend="mysqli.real-escape-string">属性转义</link>.
+ </para>
+ </listitem>
+ </varlistentry>
+ </variablelist>
+ </para>
+ </refsect1>
+
+ <refsect1 role="returnvalues">
+ &reftitle.returnvalues;
+ <para>
+ &return.success;
+ </para>
+ </refsect1>
+
+ <refsect1 role="seealso">
+ &reftitle.seealso;
+ <para>
+ <simplelist>
+ <member><function>mysqli_query</function></member>
+ <member><function>mysqli_store_result</function></member>
+ <member><function>mysqli_use_result</function></member>
+ </simplelist>
+ </para>
+ </refsect1>
+
+</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:"~/.phpdoc/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
+-->
=======================================
--- /dev/null
+++ /trunk/xml/reference/mysqli/mysqli/reap-async-query.xml Sun Aug 14
01:16:33 2011
@@ -0,0 +1,75 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!-- $Revision: 299158 $ -->
+<refentry xml:id="mysqli.reap-async-query"
xmlns="http://docbook.org/ns/docbook"
xmlns:xlink="http://www.w3.org/1999/xlink">
+ <refnamediv>
+ <refname>mysqli::reap_async_query</refname>
+ <refname>mysqli_reap_async_query</refname>
+ <refpurpose>Get result from async query</refpurpose>
+ </refnamediv>
+
+ <refsect1 role="description">
+ &reftitle.description;
+ <para>&style.oop;</para>
+ <methodsynopsis>
+ <modifier>public</modifier>
<type>mysqli_result</type><methodname>mysqli::reap_async_query</methodname>
+ <void />
+ </methodsynopsis>
+ <para>&style.procedural;</para>
+ <methodsynopsis>
+
<type>mysqli_result</type><methodname>mysqli_reap_async_query</methodname>
+ <methodparam><type>mysql</type><parameter>link</parameter></methodparam>
+ </methodsynopsis>
+ &warn.undocumented.func;
+ <para>
+ Get result from async query.
+ &mysqli.available.mysqlnd;
+ </para>
+ </refsect1>
+
+ <refsect1 role="parameters">
+ &reftitle.parameters;
+ <para>
+ <variablelist>
+ &mysqli.link.description;
+ </variablelist>
+ </para>
+ </refsect1>
+
+ <refsect1 role="returnvalues">
+ &reftitle.returnvalues;
+ <para>
+ Returns <classname>mysqli_result</classname> in success, &false;
otherwise.
+ </para>
+ </refsect1>
+
+ <refsect1 role="seealso">
+ &reftitle.seealso;
+ <para>
+ <simplelist>
+ <member><function>mysqli_poll</function></member>
+ </simplelist>
+ </para>
+ </refsect1>
+
+</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:"~/.phpdoc/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
+-->
=======================================
--- /dev/null
+++ /trunk/xml/reference/mysqli/mysqli/rollback.xml Sun Aug 14 01:16:33 2011
@@ -0,0 +1,186 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!-- $Revision: 299196 $ -->
+<refentry xml:id="mysqli.rollback" xmlns="http://docbook.org/ns/docbook">
+ <refnamediv>
+ <refname>mysqli::rollback</refname>
+ <refname>mysqli_rollback</refname>
+ <refpurpose>Rolls back current transaction</refpurpose>
+ </refnamediv>
+
+ <refsect1 role="description">
+ &reftitle.description;
+ <para>&style.oop;</para>
+ <methodsynopsis>
+ <type>bool</type><methodname>mysqli::rollback</methodname>
+ <void/>
+ </methodsynopsis>
+ <para>&style.procedural;</para>
+ <methodsynopsis>
+ <type>bool</type><methodname>mysqli_rollback</methodname>
+
<methodparam><type>mysqli</type><parameter>link</parameter></methodparam>
+ </methodsynopsis>
+ <para>
+ Rollbacks the current transaction for the database.
+ </para>
+ </refsect1>
+
+ <refsect1 role="parameters">
+ &reftitle.parameters;
+ <para>
+ <variablelist>
+ &mysqli.link.description;
+ </variablelist>
+ </para>
+ </refsect1>
+
+ <refsect1 role="returnvalues">
+ &reftitle.returnvalues;
+ <para>
+ &return.success;
+ </para>
+ </refsect1>
+
+ <refsect1 role="examples">
+ &reftitle.examples;
+ <example>
+ <title><methodname>mysqli::rollback</methodname> example</title>
+ <para>&style.oop;</para>
+ <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();
+}
+
+/* disable autocommit */
+$mysqli->autocommit(FALSE);
+
+$mysqli->query("CREATE TABLE myCity LIKE City");
+$mysqli->query("ALTER TABLE myCity Type=InnoDB");
+$mysqli->query("INSERT INTO myCity SELECT * FROM City LIMIT 50");
+
+/* commit insert */
+$mysqli->commit();
+
+/* delete all rows */
+$mysqli->query("DELETE FROM myCity");
+
+if ($result = $mysqli->query("SELECT COUNT(*) FROM myCity")) {
+ $row = $result->fetch_row();
+ printf("%d rows in table myCity.\n", $row[0]);
+ /* Free result */
+ $result->close();
+}
+
+/* Rollback */
+$mysqli->rollback();
+
+if ($result = $mysqli->query("SELECT COUNT(*) FROM myCity")) {
+ $row = $result->fetch_row();
+ printf("%d rows in table myCity (after rollback).\n", $row[0]);
+ /* Free result */
+ $result->close();
+}
+
+/* Drop table myCity */
+$mysqli->query("DROP TABLE myCity");
+
+$mysqli->close();
+?>
+]]>
+ </programlisting>
+ <para>&style.procedural;</para>
+ <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();
+}
+
+/* disable autocommit */
+mysqli_autocommit($link, FALSE);
+
+mysqli_query($link, "CREATE TABLE myCity LIKE City");
+mysqli_query($link, "ALTER TABLE myCity Type=InnoDB");
+mysqli_query($link, "INSERT INTO myCity SELECT * FROM City LIMIT 50");
+
+/* commit insert */
+mysqli_commit($link);
+
+/* delete all rows */
+mysqli_query($link, "DELETE FROM myCity");
+
+if ($result = mysqli_query($link, "SELECT COUNT(*) FROM myCity")) {
+ $row = mysqli_fetch_row($result);
+ printf("%d rows in table myCity.\n", $row[0]);
+ /* Free result */
+ mysqli_free_result($result);
+}
+
+/* Rollback */
+mysqli_rollback($link);
+
+if ($result = mysqli_query($link, "SELECT COUNT(*) FROM myCity")) {
+ $row = mysqli_fetch_row($result);
+ printf("%d rows in table myCity (after rollback).\n", $row[0]);
+ /* Free result */
+ mysqli_free_result($result);
+}
+
+/* Drop table myCity */
+mysqli_query($link, "DROP TABLE myCity");
+
+mysqli_close($link);
+?>
+]]>
+ </programlisting>
+ &examples.outputs;
+ <screen>
+<![CDATA[
+0 rows in table myCity.
+50 rows in table myCity (after rollback).
+]]>
+ </screen>
+ </example>
+ </refsect1>
+
+ <refsect1 role="seealso">
+ &reftitle.seealso;
+ <para>
+ <simplelist>
+ <member><function>mysqli_commit</function></member>
+ <member><function>mysqli_autocommit</function></member>
+ </simplelist>
+ </para>
+ </refsect1>
+
+</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:"~/.phpdoc/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
+-->
=======================================
--- /dev/null
+++ /trunk/xml/reference/mysqli/mysqli/select-db.xml Sun Aug 14 01:16:33
2011
@@ -0,0 +1,171 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!-- $Revision: 299196 $ -->
+<refentry xml:id="mysqli.select-db" xmlns="http://docbook.org/ns/docbook">
+ <refnamediv>
+ <refname>mysqli::select_db</refname>
+ <refname>mysqli_select_db</refname>
+ <refpurpose>Selects the default database for database
queries</refpurpose>
+ </refnamediv>
+
+ <refsect1 role="description">
+ &reftitle.description;
+ <para>&style.oop;</para>
+ <methodsynopsis>
+ <type>bool</type><methodname>mysqli::select_db</methodname>
+
<methodparam><type>string</type><parameter>dbname</parameter></methodparam>
+ </methodsynopsis>
+ <para>&style.procedural;</para>
+ <methodsynopsis>
+ <type>bool</type><methodname>mysqli_select_db</methodname>
+
<methodparam><type>mysqli</type><parameter>link</parameter></methodparam>
+
<methodparam><type>string</type><parameter>dbname</parameter></methodparam>
+ </methodsynopsis>
+ <para>
+ Selects the default database to be used when performing queries against
+ the database connection.
+ </para>
+ <note>
+ <para>
+ This function should only be used to change the default database for
the
+ connection. You can select the default database with 4th parameter in
+ <function>mysqli_connect</function>.
+ </para>
+ </note>
+ </refsect1>
+
+ <refsect1 role="parameters">
+ &reftitle.parameters;
+ <para>
+ <variablelist>
+ &mysqli.link.description;
+ <varlistentry>
+ <term><parameter>dbname</parameter></term>
+ <listitem>
+ <para>
+ The database name.
+ </para>
+ </listitem>
+ </varlistentry>
+ </variablelist>
+ </para>
+ </refsect1>
+
+ <refsect1 role="returnvalues">
+ &reftitle.returnvalues;
+ <para>
+ &return.success;
+ </para>
+ </refsect1>
+
+ <refsect1 role="examples">
+ &reftitle.examples;
+ <example>
+ <title><methodname>mysqli::select_db</methodname> example</title>
+ <para>&style.oop;</para>
+ <programlisting role="php">
+<![CDATA[
+<?php
+$mysqli = new mysqli("localhost", "my_user", "my_password", "test");
+
+/* check connection */
+if (mysqli_connect_errno()) {
+ printf("Connect failed: %s\n", mysqli_connect_error());
+ exit();
+}
+
+/* return name of current default database */
+if ($result = $mysqli->query("SELECT DATABASE()")) {
+ $row = $result->fetch_row();
+ printf("Default database is %s.\n", $row[0]);
+ $result->close();
+}
+
+/* change db to world db */
+$mysqli->select_db("world");
+
+/* return name of current default database */
+if ($result = $mysqli->query("SELECT DATABASE()")) {
+ $row = $result->fetch_row();
+ printf("Default database is %s.\n", $row[0]);
+ $result->close();
+}
+
+$mysqli->close();
+?>
+]]>
+ </programlisting>
+ <para>&style.procedural;</para>
+ <programlisting role="php">
+<![CDATA[
+<?php
+$link = mysqli_connect("localhost", "my_user", "my_password", "test");
+
+/* check connection */
+if (mysqli_connect_errno()) {
+ printf("Connect failed: %s\n", mysqli_connect_error());
+ exit();
+}
+
+/* return name of current default database */
+if ($result = mysqli_query($link, "SELECT DATABASE()")) {
+ $row = mysqli_fetch_row($result);
+ printf("Default database is %s.\n", $row[0]);
+ mysqli_free_result($result);
+}
+
+/* change db to world db */
+mysqli_select_db($link, "world");
+
+/* return name of current default database */
+if ($result = mysqli_query($link, "SELECT DATABASE()")) {
+ $row = mysqli_fetch_row($result);
+ printf("Default database is %s.\n", $row[0]);
+ mysqli_free_result($result);
+}
+
+mysqli_close($link);
+?>
+]]>
+ </programlisting>
+ &examples.outputs;
+ <screen>
+<![CDATA[
+Default database is test.
+Default database is world.
+]]>
+ </screen>
+ </example>
+ </refsect1>
+
+ <refsect1 role="seealso">
+ &reftitle.seealso;
+ <para>
+ <simplelist>
+ <member><function>mysqli_connect</function></member>
+ <member><function>mysqli_real_connect</function></member>
+ </simplelist>
+ </para>
+ </refsect1>
+
+</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:"~/.phpdoc/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
+-->
=======================================
--- /dev/null
+++ /trunk/xml/reference/mysqli/mysqli/set-charset.xml Sun Aug 14 01:16:33
2011
@@ -0,0 +1,161 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!-- $Revision: 299196 $ -->
+<refentry xml:id="mysqli.set-charset"
xmlns="http://docbook.org/ns/docbook"
xmlns:xlink="http://www.w3.org/1999/xlink">
+ <refnamediv>
+ <refname>mysqli::set_charset</refname>
+ <refname>mysqli_set_charset</refname>
+ <refpurpose>Sets the default client character set</refpurpose>
+ </refnamediv>
+
+ <refsect1 role="description">
+ &reftitle.description;
+ <para>&style.oop;</para>
+ <methodsynopsis>
+ <type>bool</type><methodname>mysqli::set_charset</methodname>
+
<methodparam><type>string</type><parameter>charset</parameter></methodparam>
+ </methodsynopsis>
+ <para>&style.procedural;</para>
+ <methodsynopsis>
+ <type>bool</type><methodname>mysqli_set_charset</methodname>
+
<methodparam><type>mysqli</type><parameter>link</parameter></methodparam>
+
<methodparam><type>string</type><parameter>charset</parameter></methodparam>
+ </methodsynopsis>
+ <para>
+ Sets the default character set to be used when sending data from and to
+ the database server.
+ </para>
+ </refsect1>
+
+ <refsect1 role="parameters">
+ &reftitle.parameters;
+ <para>
+ <variablelist>
+ &mysqli.link.description;
+ <varlistentry>
+ <term><parameter>charset</parameter></term>
+ <listitem>
+ <para>
+ The charset to be set as default.
+ </para>
+ </listitem>
+ </varlistentry>
+ </variablelist>
+ </para>
+ </refsect1>
+
+ <refsect1 role="returnvalues">
+ &reftitle.returnvalues;
+ <para>
+ &return.success;
+ </para>
+ </refsect1>
+
+ <refsect1 role="notes">
+ &reftitle.notes;
+ <note>
+ <para>
+ To use this function on a Windows platform you need MySQL client
library
+ version 4.1.11 or above (for MySQL 5.0 you need 5.0.6 or above).
+ </para>
+ </note>
+ <note>
+ <para>
+ This is the preferred way to change the charset. Using
+ <function>mysqli::query</function> to execute <literal>SET
NAMES ..</literal>
+ is not recommended.
+ </para>
+ </note>
+ </refsect1>
+
+ <refsect1 role="examples">
+ &reftitle.examples;
+ <example>
+ <title><methodname>mysqli::set_charset</methodname> example</title>
+ <para>&style.oop;</para>
+ <programlisting role="php">
+<![CDATA[
+<?php
+$mysqli = new mysqli("localhost", "my_user", "my_password", "test");
+
+/* check connection */
+if (mysqli_connect_errno()) {
+ printf("Connect failed: %s\n", mysqli_connect_error());
+ exit();
+}
+
+/* change character set to utf8 */
+if (!$mysqli->set_charset("utf8")) {
+ printf("Error loading character set utf8: %s\n", $mysqli->error);
+} else {
+ printf("Current character set: %s\n", $mysqli->character_set_name());
+}
+
+$mysqli->close();
+?>
+]]>
+ </programlisting>
+ <para>&style.procedural;</para>
+ <programlisting role="php">
+<![CDATA[
+<?php
+$link = mysqli_connect('localhost', 'my_user', 'my_password', 'test');
+
+/* check connection */
+if (mysqli_connect_errno()) {
+ printf("Connect failed: %s\n", mysqli_connect_error());
+ exit();
+}
+
+/* change character set to utf8 */
+if (!mysqli_set_charset($link, "utf8")) {
+ printf("Error loading character set utf8: %s\n", mysqli_error($link));
+} else {
+ printf("Current character set: %s\n",
mysqli_character_set_name($link));
+}
+
+mysqli_close($link);
+?>
+]]>
+ </programlisting>
+ &examples.outputs;
+ <screen>
+<![CDATA[
+Current character set: utf8
+]]>
+ </screen>
+ </example>
+ </refsect1>
+
+ <refsect1 role="seealso">
+ &reftitle.seealso;
+ <para>
+ <simplelist>
+ <member><function>mysqli_character_set_name</function></member>
+ <member><function>mysqli_real_escape_string</function></member>
+ <member><link xlink:href="&url.mysql.charsets;">List of character sets
that MySQL supports</link></member>
+ </simplelist>
+ </para>
+ </refsect1>
+
+</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:"~/.phpdoc/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
+-->
=======================================
--- /dev/null
+++ /trunk/xml/reference/mysqli/mysqli/set-local-infile-default.xml Sun Aug
14 01:16:33 2011
@@ -0,0 +1,74 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!-- $Revision: 297028 $ -->
+<refentry xml:id="mysqli.set-local-infile-default"
xmlns="http://docbook.org/ns/docbook">
+ <refnamediv>
+ <refname>mysqli::set_local_infile_default</refname>
+ <refname>mysqli_set_local_infile_default</refname>
+ <refpurpose>Unsets user defined handler for load local infile
command</refpurpose>
+ </refnamediv>
+
+ <refsect1 role="description">
+ &reftitle.description;
+ <methodsynopsis>
+
<type>void</type><methodname>mysqli_set_local_infile_default</methodname>
+
<methodparam><type>mysqli</type><parameter>link</parameter></methodparam>
+ </methodsynopsis>
+
+ <para>
+ Deactivates a <literal>LOAD DATA INFILE LOCAL</literal> handler
previously
+ set with <function>mysqli_set_local_infile_handler</function>.
+ </para>
+ </refsect1>
+
+ <refsect1 role="parameters">
+ &reftitle.parameters;
+ <para>
+ <variablelist>
+ &mysqli.link.description;
+ </variablelist>
+ </para>
+ </refsect1>
+
+ <refsect1 role="returnvalues">
+ &reftitle.returnvalues;
+ <para>
+ &return.void;
+ </para>
+ </refsect1>
+
+ <refsect1 role="examples">
+ &reftitle.examples;
+ <para>See <function>mysqli_set_local_infile_handler</function>
examples</para>
+ </refsect1>
+
+ <refsect1 role="seealso">
+ &reftitle.seealso;
+ <para>
+ <simplelist>
+ <member><function>mysqli_set_local_infile_handler</function></member>
+ </simplelist>
+ </para>
+ </refsect1>
+
+</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:"~/.phpdoc/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
+-->
=======================================
--- /dev/null
+++ /trunk/xml/reference/mysqli/mysqli/set-local-infile-handler.xml Sun Aug
14 01:16:33 2011
@@ -0,0 +1,206 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!-- $Revision: 299196 $ -->
+<refentry xml:id="mysqli.set-local-infile-handler"
xmlns="http://docbook.org/ns/docbook">
+ <refnamediv>
+ <refname>mysqli::set_local_infile_handler</refname>
+ <refname>mysqli_set_local_infile_handler</refname>
+ <refpurpose>Set callback function for LOAD DATA LOCAL INFILE
command</refpurpose>
+ </refnamediv>
+
+ <refsect1 role="description">
+ &reftitle.description;
+ <para>&style.oop;</para>
+ <methodsynopsis>
+
<type>bool</type><methodname>mysqli::set_local_infile_handler</methodname>
+
<methodparam><type>mysqli</type><parameter>link</parameter></methodparam>
+
<methodparam><type>callback</type><parameter>read_func</parameter></methodparam>
+ </methodsynopsis>
+ <para>&style.procedural;</para>
+ <methodsynopsis>
+
<type>bool</type><methodname>mysqli_set_local_infile_handler</methodname>
+
<methodparam><type>mysqli</type><parameter>link</parameter></methodparam>
+
<methodparam><type>callback</type><parameter>read_func</parameter></methodparam>
+ </methodsynopsis>
+
+ <para>Set callback function for LOAD DATA LOCAL INFILE command</para>
+
+ <para>
+ The callbacks task is to read input from the file specified in the
+ <literal>LOAD DATA LOCAL INFILE</literal> and to reformat it into
+ the format understood by <literal>LOAD DATA INFILE</literal>.
+ </para>
+
+ <para>
+ The returned data needs to match the format specified in the
+ <literal>LOAD DATA</literal>
+ </para>
+ </refsect1>
+
+ <refsect1 role="parameters">
+ &reftitle.parameters;
+ <para>
+ <variablelist>
+ &mysqli.link.description;
+ <varlistentry>
+ <term><parameter>read_func</parameter></term>
+ <listitem>
+ <para>
+ A callback function or object method taking the following
parameters:
+ </para>
+ <variablelist>
+ <varlistentry>
+ <term><parameter>stream</parameter></term>
+ <listitem><para>A PHP stream associated with the SQL commands
INFILE</para></listitem>
+ </varlistentry>
+ <varlistentry>
+ <term><parameter>&amp;buffer</parameter></term>
+ <listitem><para>A string buffer to store the rewritten input
into</para></listitem>
+ </varlistentry>
+ <varlistentry>
+ <term><parameter>buflen</parameter></term>
+ <listitem><para>The maximum number of characters to be stored in
the buffer</para></listitem>
+ </varlistentry>
+ <varlistentry>
+ <term><parameter>&amp;errormsg</parameter></term>
+ <listitem><para>If an error occurs you can store an error message
in here</para></listitem>
+ </varlistentry>
+ </variablelist>
+ </listitem>
+ </varlistentry>
+ </variablelist>
+ </para>
+ <para>
+ The callback function should return the number of characters stored
+ in the <parameter>buffer</parameter> or a negative value if an error
+ occurred.
+ </para>
+ </refsect1>
+
+ <refsect1 role="returnvalues">
+ &reftitle.returnvalues;
+ <para>
+ &return.success;
+ </para>
+ </refsect1>
+
+ <refsect1 role="examples">
+ &reftitle.examples;
+ <example>
+ <title><methodname>mysqli::set_local_infile_handler</methodname>
example</title>
+ <para>&style.oop;</para>
+ <programlisting role="php">
+<![CDATA[
+<?php
+ $db = mysqli_init();
+ $db->real_connect("localhost","root","","test");
+
+ function callme($stream, &$buffer, $buflen, &$errmsg)
+ {
+ $buffer = fgets($stream);
+
+ echo $buffer;
+
+ // convert to upper case and replace "," delimiter with [TAB]
+ $buffer = strtoupper(str_replace(",", "\t", $buffer));
+
+ return strlen($buffer);
+ }
+
+
+ echo "Input:\n";
+
+ $db->set_local_infile_handler("callme");
+ $db->query("LOAD DATA LOCAL INFILE 'input.txt' INTO TABLE t1");
+ $db->set_local_infile_default();
+
+ $res = $db->query("SELECT * FROM t1");
+
+ echo "\nResult:\n";
+ while ($row = $res->fetch_assoc()) {
+ echo join(",", $row)."\n";
+ }
+?>
+]]>
+ </programlisting>
+ <para>&style.procedural;</para>
+ <programlisting role="php">
+<![CDATA[
+<?php
+ $db = mysqli_init();
+ mysqli_real_connect($db, "localhost","root","","test");
+
+ function callme($stream, &$buffer, $buflen, &$errmsg)
+ {
+ $buffer = fgets($stream);
+
+ echo $buffer;
+
+ // convert to upper case and replace "," delimiter with [TAB]
+ $buffer = strtoupper(str_replace(",", "\t", $buffer));
+
+ return strlen($buffer);
+ }
+
+
+ echo "Input:\n";
+
+ mysqli_set_local_infile_handler($db, "callme");
+ mysqli_query($db, "LOAD DATA LOCAL INFILE 'input.txt' INTO TABLE t1");
+ mysqli_set_local_infile_default($db);
+
+ $res = mysqli_query($db, "SELECT * FROM t1");
+
+
+ echo "\nResult:\n";
+ while ($row = mysqli_fetch_assoc($res)) {
+ echo join(",", $row)."\n";
+ }
+?>
+]]>
+ </programlisting>
+ &examples.outputs;
+ <screen>
+<![CDATA[
+Input:
+23,foo
+42,bar
+
+Output:
+23,FOO
+42,BAR
+]]>
+ </screen>
+ </example>
+ </refsect1>
+
+ <refsect1 role="seealso">
+ &reftitle.seealso;
+ <para>
+ <simplelist>
+ <member><function>mysqli_set_local_infile_default</function></member>
+ </simplelist>
+ </para>
+ </refsect1>
+
+</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:"~/.phpdoc/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
+-->
=======================================
--- /dev/null
+++ /trunk/xml/reference/mysqli/mysqli/sqlstate.xml Sun Aug 14 01:16:33 2011
@@ -0,0 +1,139 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!-- $Revision: 299196 $ -->
+<refentry xml:id="mysqli.sqlstate" xmlns="http://docbook.org/ns/docbook"
xmlns:xlink="http://www.w3.org/1999/xlink">
+ <refnamediv>
+ <refname>mysqli->sqlstate</refname>
+ <refname>mysqli_sqlstate</refname>
+ <refpurpose>Returns the SQLSTATE error from previous MySQL
operation</refpurpose>
+ </refnamediv>
+
+ <refsect1 role="description">
+ &reftitle.description;
+ <para>&style.oop;</para>
+ <classsynopsis>
+ <ooclass><classname>mysqli</classname></ooclass>
+
<fieldsynopsis><type>string</type><varname>sqlstate</varname></fieldsynopsis>
+ </classsynopsis>
+ <para>&style.procedural;</para>
+ <methodsynopsis>
+ <type>string</type><methodname>mysqli_sqlstate</methodname>
+
<methodparam><type>mysqli</type><parameter>link</parameter></methodparam>
+ </methodsynopsis>
+ <para>
+ Returns a string containing the SQLSTATE error code for the last error.
+ The error code consists of five characters. <literal>'00000'</literal>
means no error.
+ The values are specified by ANSI SQL and ODBC. For a list of possible
values, see
+ <link xlink:href="&url.mysql.docs.error;">&url.mysql.docs.error;</link>.
+ </para>
+ <note>
+ <para>
+ Note that not all MySQL errors are yet mapped to SQLSTATE's.
+ The value <literal>HY000</literal> (general error) is used for
unmapped errors.
+ </para>
+ </note>
+ </refsect1>
+
+ <refsect1 role="parameters">
+ &reftitle.parameters;
+ <para>
+ <variablelist>
+ &mysqli.link.description;
+ </variablelist>
+ </para>
+ </refsect1>
+
+ <refsect1 role="returnvalues">
+ &reftitle.returnvalues;
+ <para>
+ Returns a string containing the SQLSTATE error code for the last error.
+ The error code consists of five characters. <literal>'00000'</literal>
means no error.
+ </para>
+ </refsect1>
+
+ <refsect1 role="examples">
+ &reftitle.examples;
+ <example>
+ <title><varname>mysqli->sqlstate</varname> example</title>
+ <para>&style.oop;</para>
+ <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();
+}
+
+/* Table City already exists, so we should get an error */
+if (!$mysqli->query("CREATE TABLE City (ID INT, Name VARCHAR(30))")) {
+ printf("Error - SQLSTATE %s.\n", $mysqli->sqlstate);
+}
+
+$mysqli->close();
+?>
+]]>
+ </programlisting>
+ <para>&style.procedural;</para>
+ <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();
+}
+
+/* Table City already exists, so we should get an error */
+if (!mysqli_query($link, "CREATE TABLE City (ID INT, Name VARCHAR(30))")) {
+ printf("Error - SQLSTATE %s.\n", mysqli_sqlstate($link));
+}
+
+mysqli_close($link);
+?>
+]]>
+ </programlisting>
+ &examples.outputs;
+ <screen>
+<![CDATA[
+Error - SQLSTATE 42S01.
+]]>
+ </screen>
+ </example>
+ </refsect1>
+
+ <refsect1 role="seealso">
+ &reftitle.seealso;
+ <para>
+ <simplelist>
+ <member><function>mysqli_errno</function></member>
+ <member><function>mysqli_error</function></member>
+ </simplelist>
+ </para>
+ </refsect1>
+
+</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:"~/.phpdoc/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
+-->
=======================================
--- /dev/null
+++ /trunk/xml/reference/mysqli/mysqli/ssl-set.xml Sun Aug 14 01:16:33 2011
@@ -0,0 +1,138 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!-- $Revision: 299158 $ -->
+<refentry xml:id="mysqli.ssl-set" xmlns="http://docbook.org/ns/docbook">
+ <refnamediv>
+ <refname>mysqli::ssl_set</refname>
+ <refname>mysqli_ssl_set</refname>
+ <refpurpose>Used for establishing secure connections using
SSL</refpurpose>
+ </refnamediv>
+
+ <refsect1 role="description">
+ &reftitle.description;
+ <para>&style.oop;</para>
+ <methodsynopsis>
+ <type>bool</type><methodname>mysqli::ssl_set</methodname>
+ <methodparam><type>string</type><parameter>key</parameter></methodparam>
+
<methodparam><type>string</type><parameter>cert</parameter></methodparam>
+ <methodparam><type>string</type><parameter>ca</parameter></methodparam>
+
<methodparam><type>string</type><parameter>capath</parameter></methodparam>
+
<methodparam><type>string</type><parameter>cipher</parameter></methodparam>
+ </methodsynopsis>
+ <para>&style.procedural;</para>
+ <methodsynopsis>
+ <type>bool</type><methodname>mysqli_ssl_set</methodname>
+
<methodparam><type>mysqli</type><parameter>link</parameter></methodparam>
+ <methodparam><type>string</type><parameter>key</parameter></methodparam>
+
<methodparam><type>string</type><parameter>cert</parameter></methodparam>
+ <methodparam><type>string</type><parameter>ca</parameter></methodparam>
+
<methodparam><type>string</type><parameter>capath</parameter></methodparam>
+
<methodparam><type>string</type><parameter>cipher</parameter></methodparam>
+ </methodsynopsis>
+ <para>
+ Used for establishing secure connections using SSL. It must be called
+ before <function>mysqli_real_connect</function>. This function does
+ nothing unless OpenSSL support is enabled.
+ </para>
+
+ <para>
+ Note that MySQL Native Driver does not support SSL, so calling this
function
+ when using MySQL Native Driver will result in an error. MySQL Native
Driver
+ is enabled by default on Microsoft Windows from PHP version 5.3
onwards.
+ </para>
+
+ </refsect1>
+
+ <refsect1 role="parameters">
+ &reftitle.parameters;
+ <para>
+ <variablelist>
+ &mysqli.link.description;
+ <varlistentry>
+ <term><parameter>key</parameter></term>
+ <listitem>
+ <para>
+ The path name to the key file.
+ </para>
+ </listitem>
+ </varlistentry>
+ <varlistentry>
+ <term><parameter>cert</parameter></term>
+ <listitem>
+ <para>
+ The path name to the certificate file.
+ </para>
+ </listitem>
+ </varlistentry>
+ <varlistentry>
+ <term><parameter>ca</parameter></term>
+ <listitem>
+ <para>
+ The path name to the certificate authority file.
+ </para>
+ </listitem>
+ </varlistentry>
+ <varlistentry>
+ <term><parameter>capath</parameter></term>
+ <listitem>
+ <para>
+ The pathname to a directory that contains trusted SSL CA
certificates
+ in PEM format.
+ </para>
+ </listitem>
+ </varlistentry>
+ <varlistentry>
+ <term><parameter>cipher</parameter></term>
+ <listitem>
+ <para>
+ A list of allowable ciphers to use for SSL encryption.
+ </para>
+ </listitem>
+ </varlistentry>
+ </variablelist>
+ </para>
+ <para>
+ Any unused SSL parameters may be given as &null;
+ </para>
+ </refsect1>
+
+ <refsect1 role="returnvalues">
+ &reftitle.returnvalues;
+ <para>
+ This function always returns &true; value. If SSL setup is
+ incorrect <function>mysqli_real_connect</function> will return an error
+ when you attempt to connect.
+ </para>
+ </refsect1>
+
+ <refsect1 role="seealso">
+ &reftitle.seealso;
+ <para>
+ <simplelist>
+ <member><function>mysqli_options</function></member>
+ <member><function>mysqli_real_connect</function></member>
+ </simplelist>
+ </para>
+ </refsect1>
+
+</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:"~/.phpdoc/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
+-->
=======================================
***Additional files exist in this changeset.***
Reply all
Reply to author
Forward
0 new messages