cvs: phpdoc /en/reference/mysqli mysqli.xml /en/reference/mysqli/functions mysqli-affected-rows.xml mysqli-autocommit.xml mysqli-change-user.xml
mysqli-character-set-name.xml mysqli-close.xml mysqli-commit.xml mysqli-connect-errno.xml mysqli-connect-error.xml mysqli-connect.xml mysqli-debug.xml
mysqli-dump-debug-info.xml mysqli-errno.xml mysqli-error.xml mysqli-field-count.xml mysqli-get-charset.xml mysqli-get-client-info.xml
mysqli-get-client-version.xml mysqli-get-host-info.xml mysqli-get-proto-info.xml mysqli-get-server-info.xml mysqli-get-server-version.xml
mysqli-get-warnings.xml mysqli-info.xml mysqli-init.xml mysqli-insert-id.xml mysqli-kill.xml mysqli-more-results.xml mysqli-multi-query.xml
mysqli-next-result.xml mysqli-options.xml mysqli-ping.xml mysqli-prepare.xml mysqli-query.xml mysqli-real-connect.xml mysqli-real-escape-string.xml
mysqli-real-query.xml mysqli-rollback.xml mysqli-select-db.xml mysqli-set-charset.xml mysqli-set-local-infile-default.xml m!
ysqli-set-local-infile-handler.xml mysqli-sqlstate.xml mysqli-ssl-set.xml mysqli-stat.xml mysqli-stmt-init.xml mysqli-store-result.xml
mysqli-thread-id.xml mysqli-thread-safe.xml mysqli-use-result.xml mysqli-warning-count.xml /en/reference/mysqli/mysqli affected-rows.xml
autocommit.xml change-user.xml character-set-name.xml close.xml commit.xml connect-errno.xml connect-error.xml connect.xml debug.xml
dump-debug-info.xml errno.xml error.xml field-count.xml get-charset.xml get-client-info.xml get-client-version.xml get-host-info.xml
get-proto-info.xml get-server-info.xml get-server-version.xml get-warnings.xml info.xml init.xml insert-id.xml kill.xml more-results.xml
multi-query.xml next-result.xml options.xml ping.xml prepare.xml query.xml real-connect.xml real-escape-string.xml real-query.xml rollback.xml
select-db.xml set-charset.xml set-local-infile-default.xml set-local-infile-handler.xml sqlstate.xml ssl-set.xml stat.xml stmt-init.xml
store-result.xml thread-id.xml th! read-safe.xml use-result.xml warning-count.xml
| From: | Hannes Magnusson | Date: | Wed, 02 Jan 2008 14:38:33 +0000 |
| Subject: | cvs: phpdoc /en/reference/mysqli mysqli.xml /en/reference/mysqli/functions mysqli-affected-rows.xml mysqli-autocommit.xml mysqli-change-user.xml mysqli-character-set-name.xml mysqli-close.xml mysqli-commit.xml mysqli-connect-errno.xml mysqli-connect-error.xml mysqli-connect.xml mysqli-debug.xml mysqli-dump-debug-info.xml mysqli-errno.xml mysqli-error.xml mysqli-field-count.xml mysqli-get-charset.xml mysqli-get-client-info.xml mysqli-get-client-version.xml mysqli-get-host-info.xml mysqli-get-proto-info.xml mysqli-get-server-info.xml mysqli-get-server-version.xml mysqli-get-warnings.xml mysqli-info.xml mysqli-init.xml mysqli-insert-id.xml mysqli-kill.xml mysqli-more-results.xml mysqli-multi-query.xml mysqli-next-result.xml mysqli-options.xml mysqli-ping.xml mysqli-prepare.xml mysqli-query.xml mysqli-real-connect.xml mysqli-real-escape-string.xml mysqli-real-query.xml mysqli-rollback.xml mysqli-select-db.xml mysqli-set-charset.xml mysqli-set-local-infile-default.xml m! ysqli-set-local-infile-handler.xml mysqli-sqlstate.xml mysqli-ssl-set.xml mysqli-stat.xml mysqli-stmt-init.xml mysqli-store-result.xml mysqli-thread-id.xml mysqli-thread-safe.xml mysqli-use-result.xml mysqli-warning-count.xml /en/reference/mysqli/mysqli affected-rows.xml autocommit.xml change-user.xml character-set-name.xml close.xml commit.xml connect-errno.xml connect-error.xml connect.xml debug.xml dump-debug-info.xml errno.xml error.xml field-count.xml get-charset.xml get-client-info.xml get-client-version.xml get-host-info.xml get-proto-info.xml get-server-info.xml get-server-version.xml get-warnings.xml info.xml init.xml insert-id.xml kill.xml more-results.xml multi-query.xml next-result.xml options.xml ping.xml prepare.xml query.xml real-connect.xml real-escape-string.xml real-query.xml rollback.xml select-db.xml set-charset.xml set-local-infile-default.xml set-local-infile-handler.xml sqlstate.xml ssl-set.xml stat.xml stmt-init.xml store-result.xml thread-id.xml th! read-safe.xml use-result.xml warning-count.xml |
||
| Groups: | php.doc.cvs | ||
| Request: | Send a blank email to doc-cvs+get-983@lists.php.net to get a copy of this message | ||
bjori Wed Jan 2 14:38:33 2008 UTC
Added files:
/phpdoc/en/reference/mysqli/mysqli affected-rows.xml autocommit.xml
change-user.xml
character-set-name.xml close.xml
commit.xml connect-errno.xml
connect-error.xml connect.xml
debug.xml dump-debug-info.xml
errno.xml error.xml
field-count.xml get-charset.xml
get-client-info.xml
get-client-version.xml
get-host-info.xml
get-proto-info.xml
get-server-info.xml
get-server-version.xml
get-warnings.xml info.xml
init.xml insert-id.xml kill.xml
more-results.xml multi-query.xml
next-result.xml options.xml
ping.xml prepare.xml query.xml
real-connect.xml
real-escape-string.xml
real-query.xml rollback.xml
select-db.xml set-charset.xml
set-local-infile-default.xml
set-local-infile-handler.xml
sqlstate.xml ssl-set.xml
stat.xml stmt-init.xml
store-result.xml thread-id.xml
thread-safe.xml use-result.xml
warning-count.xml
Removed files:
/phpdoc/en/reference/mysqli/functions mysqli-affected-rows.xml
mysqli-autocommit.xml
mysqli-change-user.xml
mysqli-character-set-name.xml
mysqli-close.xml
mysqli-commit.xml
mysqli-connect-errno.xml
mysqli-connect-error.xml
mysqli-connect.xml
mysqli-debug.xml
mysqli-dump-debug-info.xml
mysqli-errno.xml
mysqli-error.xml
mysqli-field-count.xml
mysqli-get-charset.xml
mysqli-get-client-info.xml
mysqli-get-client-version.xml
mysqli-get-host-info.xml
mysqli-get-proto-info.xml
mysqli-get-server-info.xml
mysqli-get-server-version.xml
mysqli-get-warnings.xml
mysqli-info.xml
mysqli-init.xml
mysqli-insert-id.xml
mysqli-kill.xml
mysqli-more-results.xml
mysqli-multi-query.xml
mysqli-next-result.xml
mysqli-options.xml
mysqli-ping.xml
mysqli-prepare.xml
mysqli-query.xml
mysqli-real-connect.xml
mysqli-real-escape-string.xml
mysqli-real-query.xml
mysqli-rollback.xml
mysqli-select-db.xml
mysqli-set-charset.xml
mysqli-set-local-infile-default.xml
mysqli-set-local-infile-handler.xml
mysqli-sqlstate.xml
mysqli-ssl-set.xml
mysqli-stat.xml
mysqli-stmt-init.xml
mysqli-store-result.xml
mysqli-thread-id.xml
mysqli-thread-safe.xml
mysqli-use-result.xml
mysqli-warning-count.xml
Modified files:
/phpdoc/en/reference/mysqli mysqli.xml
Log:
Rename functions/mysqli-*.xml to mysqli/*.xml
http://cvs.php.net/viewvc.cgi/phpdoc/en/reference/mysqli/mysqli.xml?r1=1.3&r2=1.4&diff_format=u Index: phpdoc/en/reference/mysqli/mysqli.xml diff -u phpdoc/en/reference/mysqli/mysqli.xml:1.3 phpdoc/en/reference/mysqli/mysqli.xml:1.4 --- phpdoc/en/reference/mysqli/mysqli.xml:1.3 Wed Dec 26 18:56:29 2007 +++ phpdoc/en/reference/mysqli/mysqli.xml Wed Jan 2 14:38:32 2008 @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="utf-8"?> -<!-- $Revision: 1.3 $ --> +<!-- $Revision: 1.4 $ --> <reference xml:id="class.mysqli" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:xi="http://www.w3.org/2001/XInclude"> <title>The MySQLi class</title> <titleabbrev>MySQLi</titleabbrev> @@ -42,71 +42,8 @@ </partintro> -<!-- &reference.mysqli.entities.mysqli; --> -<!-- {{{ FIXME: These entities should be removed and the one above used --> - &reference.mysqli.functions.mysqli-autocommit; - &reference.mysqli.functions.mysqli-change-user; - &reference.mysqli.functions.mysqli-character-set-name; - &reference.mysqli.functions.mysqli-client-encoding; - &reference.mysqli.functions.mysqli-close; - &reference.mysqli.functions.mysqli-commit; - &reference.mysqli.functions.mysqli-connect; - &reference.mysqli.functions.mysqli-debug; - &reference.mysqli.functions.mysqli-disable-reads-from-master; - &reference.mysqli.functions.mysqli-disable-rpl-parse; - &reference.mysqli.functions.mysqli-dump-debug-info; - &reference.mysqli.functions.mysqli-enable-reads-from-master; - &reference.mysqli.functions.mysqli-enable-rpl-parse; - &reference.mysqli.functions.mysqli-get-client-info; - &reference.mysqli.functions.mysqli-get-server-info; - &reference.mysqli.functions.mysqli-get-warnings; - &reference.mysqli.functions.mysqli-init; - &reference.mysqli.functions.mysqli-kill; - &reference.mysqli.functions.mysqli-set-local-infile-default; - &reference.mysqli.functions.mysqli-set-local-infile-handler; - &reference.mysqli.functions.mysqli-master-query; - &reference.mysqli.functions.mysqli-multi-query; - &reference.mysqli.functions.mysqli-more-results; - &reference.mysqli.functions.mysqli-next-result; - &reference.mysqli.functions.mysqli-options; - &reference.mysqli.functions.mysqli-ping; - &reference.mysqli.functions.mysqli-prepare; - &reference.mysqli.functions.mysqli-query; - &reference.mysqli.functions.mysqli-real-connect; - &reference.mysqli.functions.mysqli-real-escape-string; - &reference.mysqli.functions.mysqli-escape-string; - &reference.mysqli.functions.mysqli-real-query; - &reference.mysqli.functions.mysqli-rollback; - &reference.mysqli.functions.mysqli-rpl-parse-enabled; - &reference.mysqli.functions.mysqli-rpl-probe; - &reference.mysqli.functions.mysqli-rpl-query-type; - &reference.mysqli.functions.mysqli-select-db; - &reference.mysqli.functions.mysqli-set-charset; - &reference.mysqli.functions.mysqli-set-opt; - &reference.mysqli.functions.mysqli-slave-query; - &reference.mysqli.functions.mysqli-ssl-set; - &reference.mysqli.functions.mysqli-stat; - &reference.mysqli.functions.mysqli-stmt-init; - &reference.mysqli.functions.mysqli-store-result; - &reference.mysqli.functions.mysqli-thread-safe; - &reference.mysqli.functions.mysqli-use-result; + &reference.mysqli.entities.mysqli; - - &reference.mysqli.functions.mysqli-get-host-info; - &reference.mysqli.functions.mysqli-get-server-version; - &reference.mysqli.functions.mysqli-info; - &reference.mysqli.functions.mysqli-affected-rows; - &reference.mysqli.functions.mysqli-get-client-version; - &reference.mysqli.functions.mysqli-errno; - &reference.mysqli.functions.mysqli-error; - &reference.mysqli.functions.mysqli-field-count; - &reference.mysqli.functions.mysqli-insert-id; - &reference.mysqli.functions.mysqli-get-proto-info; - &reference.mysqli.functions.mysqli-sqlstate; - &reference.mysqli.functions.mysqli-thread-id; - &reference.mysqli.functions.mysqli-warning-count; -<!-- }}} --> - </reference> <!-- Keep this comment at the end of the file http://cvs.php.net/viewvc.cgi/phpdoc/en/reference/mysqli/mysqli/affected-rows.xml?view=markup&rev=1.1 Index: phpdoc/en/reference/mysqli/mysqli/affected-rows.xml +++ phpdoc/en/reference/mysqli/mysqli/affected-rows.xml <?xml version="1.0" encoding="iso-8859-1"?> <!-- $Revision: 1.1 $ --> <refentry xml:id="function.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>Procedural style:</para> <methodsynopsis> <type>int</type><methodname>mysqli_affected_rows</methodname> <methodparam><type>mysqli</type><parameter>link</parameter></methodparam> </methodsynopsis> <para>Object oriented style (property):</para> <classsynopsis> <ooclass><classname>mysqli</classname></ooclass> <fieldsynopsis><type>int</type><varname>affected_rows</varname></fieldsynopsis> </classsynopsis> <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>Object oriented style</title> <programlisting role="php"> <![CDATA[ <?php $mysqli = new mysqli("localhost", "my_user", "my_password", "world"); /* check connection */ if (mysqli_connect_errno()) { printf("Connect failed: %s\n", mysqli_connect_error()); exit(); } /* 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> </example> <example> <title>Procedural style</title> <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> </example> &example.outputs; <screen> <![CDATA[ Affected rows (INSERT): 984 Affected rows (UPDATE): 168 Affected rows (DELETE): 815 Affected rows (SELECT): 169 ]]> </screen> </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:"../../../../manual.ced" sgml-exposed-tags:nil sgml-local-catalogs:nil sgml-local-ecat-files:nil End: vim600: syn=xml fen fdm=syntax fdl=2 si vim: et tw=78 syn=sgml vi: ts=1 sw=1 --> http://cvs.php.net/viewvc.cgi/phpdoc/en/reference/mysqli/mysqli/autocommit.xml?view=markup&rev=1.1 Index: phpdoc/en/reference/mysqli/mysqli/autocommit.xml +++ phpdoc/en/reference/mysqli/mysqli/autocommit.xml <?xml version="1.0" encoding="iso-8859-1"?> <!-- $Revision: 1.1 $ --> <refentry xml:id="function.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>Procedural style:</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>Object oriented style (method)</para> <classsynopsis> <ooclass><classname>mysqli</classname></ooclass> <methodsynopsis> <type>bool</type><methodname>autocommit</methodname> <methodparam><type>bool</type><parameter>mode</parameter></methodparam> </methodsynopsis> </classsynopsis> <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>Object oriented style</title> <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> </example> <example> <title>Procedural style</title> <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> </example> &example.outputs; <screen> <![CDATA[ Autocommit is 1 ]]> </screen> </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:"../../../../manual.ced" sgml-exposed-tags:nil sgml-local-catalogs:nil sgml-local-ecat-files:nil End: vim600: syn=xml fen fdm=syntax fdl=2 si vim: et tw=78 syn=sgml vi: ts=1 sw=1 --> http://cvs.php.net/viewvc.cgi/phpdoc/en/reference/mysqli/mysqli/change-user.xml?view=markup&rev=1.1 Index: phpdoc/en/reference/mysqli/mysqli/change-user.xml +++ phpdoc/en/reference/mysqli/mysqli/change-user.xml <?xml version="1.0" encoding="iso-8859-1"?> <!-- $Revision: 1.1 $ --> <refentry xml:id="function.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>Procedural style:</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>Object oriented style (method):</para> <classsynopsis> <ooclass><classname>mysqli</classname></ooclass> <methodsynopsis> <type>bool</type><methodname>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> </classsynopsis> <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>Object oriented style</title> <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> </example> <example> <title>Procedural style</title> <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> </example> &example.outputs; <screen> <![CDATA[ Default database: world Value of variable a is NULL ]]> </screen> </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:"../../../../manual.ced" sgml-exposed-tags:nil sgml-local-catalogs:nil sgml-local-ecat-files:nil End: vim600: syn=xml fen fdm=syntax fdl=2 si vim: et tw=78 syn=sgml vi: ts=1 sw=1 --> http://cvs.php.net/viewvc.cgi/phpdoc/en/reference/mysqli/mysqli/character-set-name.xml?view=markup&rev=1.1 Index: phpdoc/en/reference/mysqli/mysqli/character-set-name.xml +++ phpdoc/en/reference/mysqli/mysqli/character-set-name.xml <?xml version="1.0" encoding="iso-8859-1"?> <!-- $Revision: 1.1 $ --> <refentry xml:id="function.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>Procedural style:</para> <methodsynopsis> <type>string</type><methodname>mysqli_character_set_name</methodname> <methodparam><type>mysqli</type><parameter>link</parameter></methodparam> </methodsynopsis> <para>Object oriented style (method):</para> <classsynopsis> <ooclass><classname>mysqli</classname></ooclass> <methodsynopsis> <type>string</type><methodname>character_set_name</methodname> <void /> </methodsynopsis> </classsynopsis> <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>Object oriented style</title> <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> </example> <example> <title>Procedural style</title> <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> </example> &example.outputs; <screen> <![CDATA[ Current character set is latin1_swedish_ci ]]> </screen> </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:"../../../../manual.ced" sgml-exposed-tags:nil sgml-local-catalogs:nil sgml-local-ecat-files:nil End: vim600: syn=xml fen fdm=syntax fdl=2 si vim: et tw=78 syn=sgml vi: ts=1 sw=1 --> http://cvs.php.net/viewvc.cgi/phpdoc/en/reference/mysqli/mysqli/close.xml?view=markup&rev=1.1 Index: phpdoc/en/reference/mysqli/mysqli/close.xml +++ phpdoc/en/reference/mysqli/mysqli/close.xml <?xml version="1.0" encoding="iso-8859-1"?> <!-- $Revision: 1.1 $ --> <refentry xml:id="function.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>Procedural style:</para> <methodsynopsis> <type>bool</type><methodname>mysqli_close</methodname> <methodparam><type>mysqli</type><parameter>link</parameter></methodparam> </methodsynopsis> <para>Object oriented style (method):</para> <classsynopsis> <ooclass><classname>mysqli</classname></ooclass> <methodsynopsis> <type>bool</type><methodname>close</methodname> <void /> </methodsynopsis> </classsynopsis> <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="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:"../../../../manual.ced" sgml-exposed-tags:nil sgml-local-catalogs:nil sgml-local-ecat-files:nil End: vim600: syn=xml fen fdm=syntax fdl=2 si vim: et tw=78 syn=sgml vi: ts=1 sw=1 --> http://cvs.php.net/viewvc.cgi/phpdoc/en/reference/mysqli/mysqli/commit.xml?view=markup&rev=1.1 Index: phpdoc/en/reference/mysqli/mysqli/commit.xml +++ phpdoc/en/reference/mysqli/mysqli/commit.xml <?xml version="1.0" encoding="iso-8859-1"?> <!-- $Revision: 1.1 $ --> <refentry xml:id="function.mysqli-commit" xmlns="http://docbook.org/ns/docbook"> <refnamediv> <refname>mysqli_commit</refname> <refname>mysqli->commit()</refname> <refpurpose>Commits the current transaction</refpurpose> </refnamediv> <refsect1 role="description"> &reftitle.description; <para>Procedural style:</para> <methodsynopsis> <type>bool</type><methodname>mysqli_commit</methodname> <methodparam><type>mysqli</type><parameter>link</parameter></methodparam> </methodsynopsis> <para>Object oriented style (method)</para> <classsynopsis> <ooclass><classname>mysqli</classname></ooclass> <methodsynopsis> <type>bool</type><methodname>commit</methodname> <void /> </methodsynopsis> </classsynopsis> <para> Commits the current transaction 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> &return.success; </para> </refsect1> <refsect1 role="examples"> &reftitle.examples; <para> <example> <title>Object oriented style</title> <programlisting role="php"> <![CDATA[ <?php $mysqli = new mysqli("localhost", "my_user", "my_password", "world"); /* check connection */ if (mysqli_connect_errno()) { printf("Connect failed: %s\n", mysqli_connect_error()); exit(); } $mysqli->query("CREATE TABLE Language LIKE CountryLanguage Type=InnoDB"); /* 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> </example> <example> <title>Procedural style</title> <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 Type=InnoDB"); /* 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> </para> </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:"../../../../manual.ced" sgml-exposed-tags:nil sgml-local-catalogs:nil sgml-local-ecat-files:nil End: vim600: syn=xml fen fdm=syntax fdl=2 si vim: et tw=78 syn=sgml vi: ts=1 sw=1 --> http://cvs.php.net/viewvc.cgi/phpdoc/en/reference/mysqli/mysqli/connect-errno.xml?view=markup&rev=1.1 Index: phpdoc/en/reference/mysqli/mysqli/connect-errno.xml +++ phpdoc/en/reference/mysqli/mysqli/connect-errno.xml <?xml version="1.0" encoding="iso-8859-1"?> <!-- $Revision: 1.1 $ --> <refentry xml:id="function.mysqli-connect-errno" xmlns="http://docbook.org/ns/docbook"> <refnamediv> <refname>mysqli_connect_errno</refname> <refpurpose>Returns the error code from last connect call</refpurpose> </refnamediv> <refsect1 role="description"> &reftitle.description; <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; <para> <example> <title><function>mysqli_connect_errno</function> example</title> <programlisting role="php"> <![CDATA[ <?php $link = @mysqli_connect("localhost", "nonexisting_user", ""); if (!$link) { printf("Can't connect to localhost. Errorcode: %d\n", mysqli_connect_errno()); } ?> ]]> </programlisting> </example> </para> </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:"../../../../manual.ced" sgml-exposed-tags:nil sgml-local-catalogs:nil sgml-local-ecat-files:nil End: vim600: syn=xml fen fdm=syntax fdl=2 si vim: et tw=78 syn=sgml vi: ts=1 sw=1 --> http://cvs.php.net/viewvc.cgi/phpdoc/en/reference/mysqli/mysqli/connect-error.xml?view=markup&rev=1.1 Index: phpdoc/en/reference/mysqli/mysqli/connect-error.xml +++ phpdoc/en/reference/mysqli/mysqli/connect-error.xml <?xml version="1.0" encoding="iso-8859-1"?> <!-- $Revision: 1.1 $ --> <refentry xml:id="function.mysqli-connect-error" xmlns="http://docbook.org/ns/docbook"> <refnamediv> <refname>mysqli_connect_error</refname> <refpurpose>Returns a string description of the last connect error</refpurpose> </refnamediv> <refsect1 role="description"> &reftitle.description; <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. An empty string if no error occurred. </para> </refsect1> <refsect1 role="examples"> &reftitle.examples; <para> <example> <title><function>mysqli_connect_error</function> example</title> <programlisting role="php"> <![CDATA[ <?php $link = @mysqli_connect("localhost", "nonexisting_user", ""); if (!$link) { printf("Can't connect to localhost. Error: %s\n", mysqli_connect_error()); } ?> ]]> </programlisting> </example> </para> </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:"../../../../manual.ced" sgml-exposed-tags:nil sgml-local-catalogs:nil sgml-local-ecat-files:nil End: vim600: syn=xml fen fdm=syntax fdl=2 si vim: et tw=78 syn=sgml vi: ts=1 sw=1 --> http://cvs.php.net/viewvc.cgi/phpdoc/en/reference/mysqli/mysqli/connect.xml?view=markup&rev=1.1 Index: phpdoc/en/reference/mysqli/mysqli/connect.xml +++ phpdoc/en/reference/mysqli/mysqli/connect.xml <?xml version="1.0" encoding="iso-8859-1"?> <!-- $Revision: 1.1 $ --> <refentry xml:id="function.mysqli-connect" xmlns="http://docbook.org/ns/docbook"> <refnamediv> <refname>mysqli_connect</refname> <refname>mysqli->__construct()</refname> <refpurpose>Open a new connection to the MySQL server</refpurpose> </refnamediv> <refsect1 role="description"> &reftitle.description; <para>Procedural style</para> <methodsynopsis> <type>mysqli</type><methodname>mysqli_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> </methodsynopsis> <para>Object oriented style (constructor):</para> <classsynopsis> <ooclass><classname>mysqli</classname></ooclass> <constructorsynopsis> <methodname>__construct</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> </constructorsynopsis> </classsynopsis> <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> </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 a object which represents the connection to a MySQL Server or &false; if the connection failed. </para> </refsect1> <refsect1 role="examples"> &reftitle.examples; <example> <title>Object oriented style</title> <programlisting role="php"> <![CDATA[ <?php $mysqli = new mysqli("localhost", "my_user", "my_password", "world"); /* check connection */ if (mysqli_connect_errno()) { printf("Connect failed: %s\n", mysqli_connect_error()); exit(); } printf("Host information: %s\n", $mysqli->host_info); /* close connection */ $mysqli->close(); ?> ]]> </programlisting> </example> <example> <title>Procedural style</title> <programlisting role="php"> <![CDATA[ <?php $link = mysqli_connect("localhost", "my_user", "my_password", "world"); /* check connection */ if (!$link) { printf("Connect failed: %s\n", mysqli_connect_error()); exit(); } printf("Host information: %s\n", mysqli_get_host_info($link)); /* close connection */ mysqli_close($link); ?> ]]> </programlisting> </example> &example.outputs; <screen> <![CDATA[ Host information: Localhost via UNIX socket ]]> </screen> </refsect1> <refsect1 role="notes"> &reftitle.notes; <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> </refentry> <!-- Keep this comment at the end of the file Local variables: mode: sgml sgml-omittag:t sgml-shorttag:t sgml-minimize-attributes:nil sgml-always-quote-attributes:t sgml-indent-step:1 sgml-indent-data:t indent-tabs-mode:nil sgml-parent-document:nil sgml-default-dtd-file:"../../../../manual.ced" sgml-exposed-tags:nil sgml-local-catalogs:nil sgml-local-ecat-files:nil End: vim600: syn=xml fen fdm=syntax fdl=2 si vim: et tw=78 syn=sgml vi: ts=1 sw=1 --> http://cvs.php.net/viewvc.cgi/phpdoc/en/reference/mysqli/mysqli/debug.xml?view=markup&rev=1.1 Index: phpdoc/en/reference/mysqli/mysqli/debug.xml +++ phpdoc/en/reference/mysqli/mysqli/debug.xml <?xml version="1.0" encoding="iso-8859-1"?> <!-- $Revision: 1.1 $ --> <refentry xml:id="function.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>Procedural style:</para> <methodsynopsis> <type>bool</type><methodname>mysqli_debug</methodname> <methodparam><type>string</type><parameter>message</parameter></methodparam> </methodsynopsis> <para>Object oriented style (method):</para> <classsynopsis> <ooclass><classname>mysqli</classname></ooclass> <methodsynopsis> <type>bool</type><methodname>debug</methodname> <methodparam><type>string</type><parameter>message</parameter></methodparam> </methodsynopsis> </classsynopsis> <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 complile 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:0,/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:"../../../../manual.ced" sgml-exposed-tags:nil sgml-local-catalogs:nil sgml-local-ecat-files:nil End: vim600: syn=xml fen fdm=syntax fdl=2 si vim: et tw=78 syn=sgml vi: ts=1 sw=1 --> http://cvs.php.net/viewvc.cgi/phpdoc/en/reference/mysqli/mysqli/dump-debug-info.xml?view=markup&rev=1.1 Index: phpdoc/en/reference/mysqli/mysqli/dump-debug-info.xml +++ phpdoc/en/reference/mysqli/mysqli/dump-debug-info.xml <?xml version="1.0" encoding="iso-8859-1"?> <!-- $Revision: 1.1 $ --> <refentry xml:id="function.mysqli-dump-debug-info" xmlns="http://docbook.org/ns/docbook"> <refnamediv> <refname>mysqli_dump_debug_info</refname> <refname>mysqli->dump_debug_info()</refname> <refpurpose>Dump debugging information into the log</refpurpose> </refnamediv> <refsect1 role="description"> &reftitle.description; <para>Procedural style:</para> <methodsynopsis> <type>bool</type><methodname>mysqli_dump_debug_info</methodname> <methodparam><type>mysqli</type><parameter>link</parameter></methodparam> </methodsynopsis> <para>Object oriented style (method):</para> <classsynopsis> <ooclass><classname>mysqli</classname></ooclass> <methodsynopsis> <type>bool</type><methodname>dump_debug_info</methodname> <void/> </methodsynopsis> </classsynopsis> <para> This function is designed to be executed by an user with the SUPER privilege and is used to dump debugging information into the log for the MySQL Server relating to the 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="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:"../../../../manual.ced" sgml-exposed-tags:nil sgml-local-catalogs:nil sgml-local-ecat-files:nil End: vim600: syn=xml fen fdm=syntax fdl=2 si vim: et tw=78 syn=sgml vi: ts=1 sw=1 --> http://cvs.php.net/viewvc.cgi/phpdoc/en/reference/mysqli/mysqli/errno.xml?view=markup&rev=1.1 Index: phpdoc/en/reference/mysqli/mysqli/errno.xml +++ phpdoc/en/reference/mysqli/mysqli/errno.xml <?xml version="1.0" encoding="iso-8859-1"?> <!-- $Revision: 1.1 $ --> <refentry xml:id="function.mysqli-errno" xmlns="http://docbook.org/ns/docbook"> <refnamediv> <refname>mysqli_errno</refname> <refname>mysqli->errno</refname> <refpurpose>Returns the error code for the most recent function call</refpurpose> </refnamediv> <refsect1 role="description"> &reftitle.description; <para>Procedural style:</para> <methodsynopsis> <type>int</type><methodname>mysqli_errno</methodname> <methodparam><type>mysqli</type><parameter>link</parameter></methodparam> </methodsynopsis> <para>Object oriented style (property):</para> <classsynopsis> <ooclass><classname>mysqli</classname></ooclass> <fieldsynopsis><type>int</type><varname>errno</varname></fieldsynopsis> </classsynopsis> <para> Returns the last error code for the most recent MySQLi function call that can succeed or fail. </para> <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> </refsect1> <refsect1 role="parameters"> &reftitle.parameters; <para> <variablelist> &mysqli.link.description; </variablelist> </para> </refsect1> <refsect1 role="returnvalues"> &reftitle.returnvalues; <para> An error code value for the last call, if it failed. zero means no error occurred. </para> </refsect1> <refsect1 role="examples"> &reftitle.examples; <example> <title>Object oriented style</title> <programlisting role="php"> <![CDATA[ <?php $mysqli = new mysqli("localhost", "my_user", "my_password", "world"); /* check connection */ if (mysqli_connect_errno()) { printf("Connect failed: %s\n", mysqli_connect_error()); exit(); } if (!$mysqli->query("SET a=1")) { printf("Errorcode: %d\n", $mysqli->errno); } /* close connection */ $mysqli->close(); ?> ]]> </programlisting> </example> <example> <title>Procedural style</title> <programlisting role="php"> <![CDATA[ <?php $link = mysqli_connect("localhost", "my_user", "my_password", "world"); /* check connection */ if (mysqli_connect_errno()) { printf("Connect failed: %s\n", mysqli_connect_error()); exit(); } if (!mysqli_query($link, "SET a=1")) { printf("Errorcode: %d\n", mysqli_errno($link)); } /* close connection */ mysqli_close($link); ?> ]]> </programlisting> </example> &example.outputs; <screen> <![CDATA[ Errorcode: 1193 ]]> </screen> </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:"../../../../manual.ced" sgml-exposed-tags:nil sgml-local-catalogs:nil sgml-local-ecat-files:nil End: vim600: syn=xml fen fdm=syntax fdl=2 si vim: et tw=78 syn=sgml vi: ts=1 sw=1 --> http://cvs.php.net/viewvc.cgi/phpdoc/en/reference/mysqli/mysqli/error.xml?view=markup&rev=1.1 Index: phpdoc/en/reference/mysqli/mysqli/error.xml +++ phpdoc/en/reference/mysqli/mysqli/error.xml <?xml version="1.0" encoding="iso-8859-1"?> <!-- $Revision: 1.1 $ --> <refentry xml:id="function.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>Procedural style:</para> <methodsynopsis> <type>string</type><methodname>mysqli_error</methodname> <methodparam><type>mysqli</type><parameter>link</parameter></methodparam> </methodsynopsis> <para>Object oriented style (property):</para> <classsynopsis> <ooclass><classname>mysqli</classname></ooclass> <fieldsynopsis><type>string</type><varname>error</varname></fieldsynopsis> </classsynopsis> <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>Object oriented style</title> <programlisting role="php"> <![CDATA[ <?php $mysqli = new mysqli("localhost", "my_user", "my_password", "world"); /* check connection */ if (mysqli_connect_errno()) { printf("Connect failed: %s\n", mysqli_connect_error()); exit(); } if (!$mysqli->query("SET a=1")) { printf("Errormessage: %s\n", $mysqli->error); } /* close connection */ $mysqli->close(); ?> ]]> </programlisting> </example> <example> <title>Procedural style</title> <programlisting role="php"> <![CDATA[ <?php $link = mysqli_connect("localhost", "my_user", "my_password", "world"); /* check connection */ if (mysqli_connect_errno()) { printf("Connect failed: %s\n", mysqli_connect_error()); exit(); } if (!mysqli_query($link, "SET a=1")) { printf("Errormessage: %s\n", mysqli_error($link)); } /* close connection */ mysqli_close($link); ?> ]]> </programlisting> </example> &example.outputs; <screen> <![CDATA[ Errormessage: Unknown system variable 'a' ]]> </screen> </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:"../../../../manual.ced" sgml-exposed-tags:nil sgml-local-catalogs:nil sgml-local-ecat-files:nil End: vim600: syn=xml fen fdm=syntax fdl=2 si vim: et tw=78 syn=sgml vi: ts=1 sw=1 --> http://cvs.php.net/viewvc.cgi/phpdoc/en/reference/mysqli/mysqli/field-count.xml?view=markup&rev=1.1 Index: phpdoc/en/reference/mysqli/mysqli/field-count.xml +++ phpdoc/en/reference/mysqli/mysqli/field-count.xml <?xml version="1.0" encoding="iso-8859-1"?> <!-- $Revision: 1.1 $ --> <refentry xml:id="function.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>Procedural style:</para> <methodsynopsis> <type>int</type><methodname>mysqli_field_count</methodname> <methodparam><type>mysqli</type><parameter>link</parameter></methodparam> </methodsynopsis> <para>Object oriented style (property):</para> <classsynopsis> <ooclass><classname>mysqli_result</classname></ooclass> <fieldsynopsis><type>int</type><varname>field_count</varname></fieldsynopsis> </classsynopsis> <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; <para> <example> <title>Object oriented style</title> <programlisting role='php'> <![CDATA[ <?php $mysqli = new mysqli("localhost", "my_user", "my_password", "test"); $mysqli->query( "DROP TABLE IF EXISTS friends"); $mysqli->query( "CREATE TABLE friends (id int, name varchar(20))"); $mysqli->query( "INSERT INTO friends VALUES (1,'Hartmut'), (2, 'Ulf')"); $mysqli->real_query($HTTP_POST_VARS['query']); 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> </example> <example> <title>Procedural style</title> <programlisting role='php'> <![CDATA[ <?php $link = mysqli_connect("localhost", "my_user", "my_password", "test"); mysqli_query($link, "DROP TABLE IF EXISTS friends"); mysqli_query($link, "CREATE TABLE friends (id int, name varchar(20))"); mysqli_query($link, "INSERT INTO friends VALUES (1,'Hartmut'), (2, 'Ulf')"); mysqli_real_query($link, $HTTP_POST_VARS['query']); 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> </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:"../../../../manual.ced" sgml-exposed-tags:nil sgml-local-catalogs:nil sgml-local-ecat-files:nil End: vim600: syn=xml fen fdm=syntax fdl=2 si vim: et tw=78 syn=sgml vi: ts=1 sw=1 --> http://cvs.php.net/viewvc.cgi/phpdoc/en/reference/mysqli/mysqli/get-charset.xml?view=markup&rev=1.1 Index: phpdoc/en/reference/mysqli/mysqli/get-charset.xml +++ phpdoc/en/reference/mysqli/mysqli/get-charset.xml <?xml version="1.0" encoding="iso-8859-1"?> <!-- $Revision: 1.1 $ --> <refentry xml:id="function.mysqli-get-charset" xmlns="http://docbook.org/ns/docbook"> <refnamediv> <refname>mysqli_get_charset</refname> <refpurpose>Returns a character set object</refpurpose> </refnamediv> <refsect1 role="description"> &reftitle.description; <methodsynopsis> <type>object</type><methodname>mysqli_get_charset</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:"../../../../manual.ced" sgml-exposed-tags:nil sgml-local-catalogs:nil sgml-local-ecat-files:nil End: vim600: syn=xml fen fdm=syntax fdl=2 si vim: et tw=78 syn=sgml vi: ts=1 sw=1 --> http://cvs.php.net/viewvc.cgi/phpdoc/en/reference/mysqli/mysqli/get-client-info.xml?view=markup&rev=1.1 Index: phpdoc/en/reference/mysqli/mysqli/get-client-info.xml +++ phpdoc/en/reference/mysqli/mysqli/get-client-info.xml <?xml version="1.0" encoding="iso-8859-1"?> <!-- $Revision: 1.1 $ --> <refentry xml:id="function.mysqli-get-client-info" xmlns="http://docbook.org/ns/docbook"> <refnamediv> <refname>mysqli_get_client_info</refname> <refpurpose>Returns the MySQL client version as a string</refpurpose> </refnamediv> <refsect1 role="description"> &reftitle.description; <methodsynopsis> <type>string</type><methodname>mysqli_get_client_info</methodname> <void /> </methodsynopsis> <para> The <function>mysqli_get_client_info</function> function is used to return a string representing the client version being used in the MySQLi extension. </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:"../../../../manual.ced" sgml-exposed-tags:nil sgml-local-catalogs:nil sgml-local-ecat-files:nil End: vim600: syn=xml fen fdm=syntax fdl=2 si vim: et tw=78 syn=sgml vi: ts=1 sw=1 --> http://cvs.php.net/viewvc.cgi/phpdoc/en/reference/mysqli/mysqli/get-client-version.xml?view=markup&rev=1.1 Index: phpdoc/en/reference/mysqli/mysqli/get-client-version.xml +++ phpdoc/en/reference/mysqli/mysqli/get-client-version.xml <?xml version="1.0" encoding="iso-8859-1"?> <!-- $Revision: 1.1 $ --> <refentry xml:id="function.mysqli-get-client-version" xmlns="http://docbook.org/ns/docbook"> <refnamediv> <refname>mysqli_get_client_version</refname> <refpurpose>Get MySQL client info</refpurpose> </refnamediv> <refsect1 role="description"> &reftitle.description; <methodsynopsis> <type>int</type><methodname>mysqli_get_client_version</methodname> <void/> </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:"../../../../manual.ced" sgml-exposed-tags:nil sgml-local-catalogs:nil sgml-local-ecat-files:nil End: vim600: syn=xml fen fdm=syntax fdl=2 si vim: et tw=78 syn=sgml vi: ts=1 sw=1 --> http://cvs.php.net/viewvc.cgi/phpdoc/en/reference/mysqli/mysqli/get-host-info.xml?view=markup&rev=1.1 Index: phpdoc/en/reference/mysqli/mysqli/get-host-info.xml +++ phpdoc/en/reference/mysqli/mysqli/get-host-info.xml <?xml version="1.0" encoding="iso-8859-1"?> <!-- $Revision: 1.1 $ --> <refentry xml:id="function.mysqli-get-host-info" xmlns="http://docbook.org/ns/docbook"> <refnamediv> <refname>mysqli_get_host_info</refname> <refname>mysqli->host_info</refname> <refpurpose>Returns a string representing the type of connection used</refpurpose> </refnamediv> <refsect1 role="description"> &reftitle.description; <para>Procdural style:</para> <methodsynopsis> <type>string</type><methodname>mysqli_get_host_info</methodname> <methodparam><type>mysqli</type><parameter>link</parameter></methodparam> </methodsynopsis> <para>Object oriented style (property):</para> <classsynopsis> <ooclass><classname>mysqli</classname></ooclass> <fieldsynopsis><type>string</type><varname>host_info</varname></fieldsynopsis> </classsynopsis> <para> The <function>mysqli_get_host_info</function> function returns a string describing the connection represented by the <parameter>link</parameter> parameter is using (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>Object oriented style</title> <programlisting role="php"> <![CDATA[ <?php $mysqli = new mysqli("localhost", "my_user", "my_password", "world"); /* check connection */ if (mysqli_connect_errno()) { printf("Connect failed: %s\n", mysqli_connect_error()); exit(); } /* print host information */ printf("Host info: %s\n", $mysqli->host_info); /* close connection */ $mysqli->close(); ?> ]]> </programlisting> </example> <example> <title>Procedural style</title> <programlisting role="php"> <![CDATA[ <?php $link = mysqli_connect("localhost", "my_user", "my_password", "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> </example> &example.outputs; <screen> <![CDATA[ Host info: Localhost via UNIX socket ]]> </screen> </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:"../../../../manual.ced" sgml-exposed-tags:nil sgml-local-catalogs:nil sgml-local-ecat-files:nil End: vim600: syn=xml fen fdm=syntax fdl=2 si vim: et tw=78 syn=sgml vi: ts=1 sw=1 --> http://cvs.php.net/viewvc.cgi/phpdoc/en/reference/mysqli/mysqli/get-proto-info.xml?view=markup&rev=1.1 Index: phpdoc/en/reference/mysqli/mysqli/get-proto-info.xml +++ phpdoc/en/reference/mysqli/mysqli/get-proto-info.xml <?xml version="1.0" encoding="iso-8859-1"?> <!-- $Revision: 1.1 $ --> <refentry xml:id="function.mysqli-get-proto-info" xmlns="http://docbook.org/ns/docbook"> <refnamediv> <refname>mysqli_get_proto_info</refname> <refname>mysqli->protocol_version</refname> <refpurpose>Returns the version of the MySQL protocol used</refpurpose> </refnamediv> <refsect1 role="description"> &reftitle.description; <para>Procedural style:</para> <methodsynopsis> <type>int</type><methodname>mysqli_get_proto_info</methodname> <methodparam><type>mysqli</type><parameter>link</parameter></methodparam> </methodsynopsis> <para>Object oriented style (property):</para> <classsynopsis> <ooclass><classname>mysqli</classname></ooclass> <fieldsynopsis><type>string</type><varname>protocol_version</varname></fieldsynopsis> </classsynopsis> <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>Object oriented style</title> <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> </example> <example> <title>Procedural style</title> <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> </example> &example.outputs; <screen> <![CDATA[ Protocol version: 10 ]]> </screen> </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:"../../../../manual.ced" sgml-exposed-tags:nil sgml-local-catalogs:nil sgml-local-ecat-files:nil End: vim600: syn=xml fen fdm=syntax fdl=2 si vim: et tw=78 syn=sgml vi: ts=1 sw=1 --> http://cvs.php.net/viewvc.cgi/phpdoc/en/reference/mysqli/mysqli/get-server-info.xml?view=markup&rev=1.1 Index: phpdoc/en/reference/mysqli/mysqli/get-server-info.xml +++ phpdoc/en/reference/mysqli/mysqli/get-server-info.xml <?xml version="1.0" encoding="iso-8859-1"?> <!-- $Revision: 1.1 $ --> <refentry xml:id="function.mysqli-get-server-info" xmlns="http://docbook.org/ns/docbook"> <refnamediv> <refname>mysqli_get_server_info</refname> <refname>mysqli->server_info</refname> <refpurpose>Returns the version of the MySQL server</refpurpose> </refnamediv> <refsect1 role="description"> &reftitle.description; <para>Procedural style:</para> <methodsynopsis> <type>string</type><methodname>mysqli_get_server_info</methodname> <methodparam><type>mysqli</type><parameter>link</parameter></methodparam> </methodsynopsis> <para>Object oriented style (property):</para> <classsynopsis> <ooclass><classname>mysqli</classname></ooclass> <fieldsynopsis><type>string</type><varname>server_info</varname></fieldsynopsis> </classsynopsis> <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>Object oriented style</title> <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> </example> <example> <title>Procedural style</title> <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> </example> &example.outputs; <screen> <![CDATA[ Server version: 4.1.2-alpha-debug ]]> </screen> </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:"../../../../manual.ced" sgml-exposed-tags:nil sgml-local-catalogs:nil sgml-local-ecat-files:nil End: vim600: syn=xml fen fdm=syntax fdl=2 si vim: et tw=78 syn=sgml vi: ts=1 sw=1 --> http://cvs.php.net/viewvc.cgi/phpdoc/en/reference/mysqli/mysqli/get-server-version.xml?view=markup&rev=1.1 Index: phpdoc/en/reference/mysqli/mysqli/get-server-version.xml +++ phpdoc/en/reference/mysqli/mysqli/get-server-version.xml <?xml version="1.0" encoding="iso-8859-1"?> <!-- $Revision: 1.1 $ --> <refentry xml:id="function.mysqli-get-server-version" xmlns="http://docbook.org/ns/docbook"> <refnamediv> <refname>mysqli_get_server_version</refname> <refname>mysqli->server_version</refname> <refpurpose>Returns the version of the MySQL server as an integer</refpurpose> </refnamediv> <refsect1 role="description"> &reftitle.description; <para>Procedural style:</para> <methodsynopsis> <type>int</type><methodname>mysqli_get_server_version</methodname> <methodparam><type>mysqli</type><parameter>link</parameter></methodparam> </methodsynopsis> <para>Object oriented style (property):</para> <classsynopsis> <ooclass><classname>mysqli</classname></ooclass> <fieldsynopsis><type>int</type><varname>server_version</varname></fieldsynopsis> </classsynopsis> <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>Object oriented style</title> <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> </example> <example> <title>Procedural style</title> <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> </example> &example.outputs; <screen> <![CDATA[ Server version: 40102 ]]> </screen> </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:"../../../../manual.ced" sgml-exposed-tags:nil sgml-local-catalogs:nil sgml-local-ecat-files:nil End: vim600: syn=xml fen fdm=syntax fdl=2 si vim: et tw=78 syn=sgml vi: ts=1 sw=1 --> http://cvs.php.net/viewvc.cgi/phpdoc/en/reference/mysqli/mysqli/get-warnings.xml?view=markup&rev=1.1 Index: phpdoc/en/reference/mysqli/mysqli/get-warnings.xml +++ phpdoc/en/reference/mysqli/mysqli/get-warnings.xml <?xml version="1.0" encoding="iso-8859-1"?> <!-- $Revision: 1.1 $ --> <refentry xml:id="function.mysqli-get-warnings" xmlns="http://docbook.org/ns/docbook"> <refnamediv> <refname>mysqli_get_warnings</refname> <refpurpose></refpurpose> </refnamediv> <refsect1 role="description"> &reftitle.description; <methodsynopsis> <type>object</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:"../../../../manual.ced" sgml-exposed-tags:nil sgml-local-catalogs:nil sgml-local-ecat-files:nil End: vim600: syn=xml fen fdm=syntax fdl=2 si vim: et tw=78 syn=sgml vi: ts=1 sw=1 --> http://cvs.php.net/viewvc.cgi/phpdoc/en/reference/mysqli/mysqli/info.xml?view=markup&rev=1.1 Index: phpdoc/en/reference/mysqli/mysqli/info.xml +++ phpdoc/en/reference/mysqli/mysqli/info.xml <?xml version="1.0" encoding="iso-8859-1"?> <!-- $Revision: 1.1 $ --> <refentry xml:id="function.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>Procedural style:</para> <methodsynopsis> <type>string</type><methodname>mysqli_info</methodname> <methodparam><type>mysqli</type><parameter>link</parameter></methodparam> </methodsynopsis> <para>Object oriented style (property)</para> <classsynopsis> <ooclass><classname>mysqli</classname></ooclass> <fieldsynopsis><type>string</type><varname>info</varname></fieldsynopsis> </classsynopsis> <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 above 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>Object oriented style</title> <programlisting role="php"> <![CDATA[ <?php $mysqli = new mysqli("localhost", "my_user", "my_password", "world"); /* check connection */ if (mysqli_connect_errno()) { printf("Connect failed: %s\n", mysqli_connect_error()); exit(); } $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> </example> <example> <title>Procedural style</title> <programlisting role="php"> <![CDATA[ <?php $link = mysqli_connect("localhost", "my_user", "my_password", "world"); /* check connection */ if (mysqli_connect_errno()) { printf("Connect failed: %s\n", mysqli_connect_error()); exit(); } 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> </example> &example.outputs; <screen> <![CDATA[ Records: 150 Duplicates: 0 Warnings: 0 ]]> </screen> </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:"../../../../manual.ced" sgml-exposed-tags:nil sgml-local-catalogs:nil sgml-local-ecat-files:nil End: vim600: syn=xml fen fdm=syntax fdl=2 si vim: et tw=78 syn=sgml vi: ts=1 sw=1 --> http://cvs.php.net/viewvc.cgi/phpdoc/en/reference/mysqli/mysqli/init.xml?view=markup&rev=1.1 Index: phpdoc/en/reference/mysqli/mysqli/init.xml +++ phpdoc/en/reference/mysqli/mysqli/init.xml <?xml version="1.0" encoding="iso-8859-1"?> <!-- $Revision: 1.1 $ --> <refentry xml:id="function.mysqli-init" xmlns="http://docbook.org/ns/docbook"> <refnamediv> <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>Procedural style:</para> <methodsynopsis> <type>mysqli</type><methodname>mysqli_init</methodname> <void/> </methodsynopsis> <para>Object oriented style (method):</para> <classsynopsis> <ooclass><classname>mysqli</classname></ooclass> <methodsynopsis> <type>mysqli</type><methodname>init</methodname> <void/> </methodsynopsis> </classsynopsis> <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="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:"../../../../manual.ced" sgml-exposed-tags:nil sgml-local-catalogs:nil sgml-local-ecat-files:nil End: vim600: syn=xml fen fdm=syntax fdl=2 si vim: et tw=78 syn=sgml vi: ts=1 sw=1 --> http://cvs.php.net/viewvc.cgi/phpdoc/en/reference/mysqli/mysqli/insert-id.xml?view=markup&rev=1.1 Index: phpdoc/en/reference/mysqli/mysqli/insert-id.xml +++ phpdoc/en/reference/mysqli/mysqli/insert-id.xml <?xml version="1.0" encoding="iso-8859-1"?> <!-- $Revision: 1.1 $ --> <refentry xml:id="function.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>Procedural style:</para> <methodsynopsis> <type>int</type><methodname>mysqli_insert_id</methodname> <methodparam><type>mysqli</type><parameter>link</parameter></methodparam> </methodsynopsis> <para>Object oriented style (property):</para> <classsynopsis> <ooclass><classname>mysqli</classname></ooclass> <fieldsynopsis><type>int</type><varname>insert_id</varname></fieldsynopsis> </classsynopsis> <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>Object oriented style</title> <programlisting role="php"> <![CDATA[ <?php $mysqli = new mysqli("localhost", "my_user", "my_password", "world"); /* check connection */ if (mysqli_connect_errno()) { printf("Connect failed: %s\n", mysqli_connect_error()); exit(); } $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> </example> <example> <title>Procedural style</title> <programlisting role="php"> <![CDATA[ <?php $link = mysqli_connect("localhost", "my_user", "my_password", "world"); /* check connection */ if (mysqli_connect_errno()) { printf("Connect failed: %s\n", mysqli_connect_error()); exit(); } 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> </example> &example.outputs; <screen> <![CDATA[ New Record has id 1. ]]> </screen> </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:"../../../../manual.ced" sgml-exposed-tags:nil sgml-local-catalogs:nil sgml-local-ecat-files:nil End: vim600: syn=xml fen fdm=syntax fdl=2 si vim: et tw=78 syn=sgml vi: ts=1 sw=1 --> http://cvs.php.net/viewvc.cgi/phpdoc/en/reference/mysqli/mysqli/kill.xml?view=markup&rev=1.1 Index: phpdoc/en/reference/mysqli/mysqli/kill.xml +++ phpdoc/en/reference/mysqli/mysqli/kill.xml <?xml version="1.0" encoding="iso-8859-1"?> <!-- $Revision: 1.1 $ --> <refentry xml:id="function.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>Procedural style:</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>Object oriented style (method)</para> <classsynopsis> <ooclass><classname>mysqli</classname></ooclass> <methodsynopsis> <type>bool</type><methodname>kill</methodname> <methodparam><type>int</type><parameter>processid</parameter></methodparam> </methodsynopsis> </classsynopsis> <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>Object oriented style</title> <programlisting role="php"> <![CDATA[ <?php $mysqli = new mysqli("localhost", "my_user", "my_password", "world"); /* check connection */ if (mysqli_connect_errno()) { printf("Connect failed: %s\n", mysqli_connect_error()); exit(); } /* determine our thread id */ $thread_id = $mysqli->thread_id; /* Kill connection */ $mysqli->kill($thread_id); /* This should produce an error */ if (!$mysqli->query("CREATE TABLE myCity LIKE City")) { printf("Error: %s\n", $mysqli->error); exit; } /* close connection */ $mysqli->close(); ?> ]]> </programlisting> </example> <example> <title>Procedural style</title> <programlisting role="php"> <![CDATA[ <?php $link = mysqli_connect("localhost", "my_user", "my_password", "world"); /* check connection */ if (mysqli_connect_errno()) { printf("Connect failed: %s\n", mysqli_connect_error()); exit(); } /* determine our thread id */ $thread_id = mysqli_thread_id($link); /* Kill connection */ mysqli_kill($link, $thread_id); /* This should produce an error */ if (!mysqli_query($link, "CREATE TABLE myCity LIKE City")) { printf("Error: %s\n", mysqli_error($link)); exit; } /* close connection */ mysqli_close($link); ?> ]]> </programlisting> </example> &example.outputs; <screen> <![CDATA[ Error: MySQL server has gone away ]]> </screen> </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:"../../../../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:"../../../../manual.ced" sgml-exposed-tags:nil sgml-local-catalogs:nil sgml-local-ecat-files:nil End: vim600: syn=xml fen fdm=syntax fdl=2 si vim: et tw=78 syn=sgml vi: ts=1 sw=1 --> http://cvs.php.net/viewvc.cgi/phpdoc/en/reference/mysqli/mysqli/more-results.xml?view=markup&rev=1.1 Index: phpdoc/en/reference/mysqli/mysqli/more-results.xml +++ phpdoc/en/reference/mysqli/mysqli/more-results.xml <?xml version="1.0" encoding="iso-8859-1"?> <!-- $Revision: 1.1 $ --> <refentry xml:id="function.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; <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:"../../../../manual.ced" sgml-exposed-tags:nil sgml-local-catalogs:nil sgml-local-ecat-files:nil End: vim600: syn=xml fen fdm=syntax fdl=2 si vim: et tw=78 syn=sgml vi: ts=1 sw=1 --> http://cvs.php.net/viewvc.cgi/phpdoc/en/reference/mysqli/mysqli/multi-query.xml?view=markup&rev=1.1 Index: phpdoc/en/reference/mysqli/mysqli/multi-query.xml +++ phpdoc/en/reference/mysqli/mysqli/multi-query.xml <?xml version="1.0" encoding="iso-8859-1"?> <!-- $Revision: 1.1 $ --> <refentry xml:id="function.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>Procedural style:</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>Object oriented style (method):</para> <classsynopsis> <ooclass><classname>mysqli</classname></ooclass> <methodsynopsis> <type>bool</type><methodname>multi_query</methodname> <methodparam><type>string</type><parameter>query</parameter></methodparam> </methodsynopsis> </classsynopsis> <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> </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>Object oriented style</title> <programlisting role="php"> <![CDATA[ <?php $mysqli = new mysqli("localhost", "my_user", "my_password", "world"); /* check connection */ if (mysqli_connect_errno()) { printf("Connect failed: %s\n", mysqli_connect_error()); exit(); } $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->close(); } /* print divider */ if ($mysqli->more_results()) { printf("-----------------\n"); } } while ($mysqli->next_result()); } /* close connection */ $mysqli->close(); ?> ]]> </programlisting> </example> <example> <title>Procedural style</title> <programlisting role="php"> <![CDATA[ <?php $link = mysqli_connect("localhost", "my_user", "my_password", "world"); /* check connection */ if (mysqli_connect_errno()) { printf("Connect failed: %s\n", mysqli_connect_error()); exit(); } $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> </example> &example.outputs.similar; <screen> <![CDATA[ my_user@localhost ----------------- Amersfoort Maastricht Dordrecht Leiden Haarlemmermeer ]]> </screen> </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:"../../../../manual.ced" sgml-exposed-tags:nil sgml-local-catalogs:nil sgml-local-ecat-files:nil End: vim600: syn=xml fen fdm=syntax fdl=2 si vim: et tw=78 syn=sgml vi: ts=1 sw=1 --> http://cvs.php.net/viewvc.cgi/phpdoc/en/reference/mysqli/mysqli/next-result.xml?view=markup&rev=1.1 Index: phpdoc/en/reference/mysqli/mysqli/next-result.xml +++ phpdoc/en/reference/mysqli/mysqli/next-result.xml <?xml version="1.0" encoding="iso-8859-1"?> <!-- $Revision: 1.1 $ --> <refentry xml:id="function.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; <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:"../../../../manual.ced" sgml-exposed-tags:nil sgml-local-catalogs:nil sgml-local-ecat-files:nil End: vim600: syn=xml fen fdm=syntax fdl=2 si vim: et tw=78 syn=sgml vi: ts=1 sw=1 --> http://cvs.php.net/viewvc.cgi/phpdoc/en/reference/mysqli/mysqli/options.xml?view=markup&rev=1.1 Index: phpdoc/en/reference/mysqli/mysqli/options.xml +++ phpdoc/en/reference/mysqli/mysqli/options.xml <?xml version="1.0" encoding="iso-8859-1"?> <!-- $Revision: 1.1 $ --> <refentry xml:id="function.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>Procedural style:</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>Object oriented style (method)</para> <classsynopsis> <ooclass><classname>mysqli</classname></ooclass> <methodsynopsis> <type>bool</type><methodname>options</methodname> <methodparam><type>int</type><parameter>option</parameter></methodparam> <methodparam><type>mixed</type><parameter>value</parameter></methodparam> </methodsynopsis> </classsynopsis> <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</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="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:"../../../../manual.ced" sgml-exposed-tags:nil sgml-local-catalogs:nil sgml-local-ecat-files:nil End: vim600: syn=xml fen fdm=syntax fdl=2 si vim: et tw=78 syn=sgml vi: ts=1 sw=1 --> http://cvs.php.net/viewvc.cgi/phpdoc/en/reference/mysqli/mysqli/ping.xml?view=markup&rev=1.1 Index: phpdoc/en/reference/mysqli/mysqli/ping.xml +++ phpdoc/en/reference/mysqli/mysqli/ping.xml <?xml version="1.0" encoding="iso-8859-1"?> <!-- $Revision: 1.1 $ --> <refentry xml:id="function.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>Procedural style:</para> <methodsynopsis> <type>bool</type><methodname>mysqli_ping</methodname> <methodparam><type>mysqli</type><parameter>link</parameter></methodparam> </methodsynopsis> <para>Object oriented style (method):</para> <classsynopsis> <ooclass><classname>mysqli</classname></ooclass> <methodsynopsis> <type>bool</type><methodname>ping</methodname> <void/> </methodsynopsis> </classsynopsis> <para> Checks whether the connection to the server is working. If it has gone down, and global option <literal>mysqli.reconnect</literal> 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>Object oriented style</title> <programlisting role="php"> <![CDATA[ <?php $mysqli = new mysqli("localhost", "my_user", "my_password", "world"); /* check connection */ if (mysqli_connect_errno()) { printf("Connect failed: %s\n", mysqli_connect_error()); exit(); } /* 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> </example> <example> <title>Procedural style</title> <programlisting role="php"> <![CDATA[ <?php $link = mysqli_connect("localhost", "my_user", "my_password", "world"); /* check connection */ if (mysqli_connect_errno()) { printf("Connect failed: %s\n", mysqli_connect_error()); exit(); } /* 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> </example> &example.outputs; <screen> <![CDATA[ Our connection is ok! ]]> </screen> </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:"../../../../manual.ced" sgml-exposed-tags:nil sgml-local-catalogs:nil sgml-local-ecat-files:nil End: vim600: syn=xml fen fdm=syntax fdl=2 si vim: et tw=78 syn=sgml vi: ts=1 sw=1 --> http://cvs.php.net/viewvc.cgi/phpdoc/en/reference/mysqli/mysqli/prepare.xml?view=markup&rev=1.1 Index: phpdoc/en/reference/mysqli/mysqli/prepare.xml +++ phpdoc/en/reference/mysqli/mysqli/prepare.xml <?xml version="1.0" encoding="iso-8859-1"?> <!-- $Revision: 1.1 $ --> <refentry xml:id="function.mysqli-prepare" xmlns="http://docbook.org/ns/docbook"> <refnamediv> <refname>mysqli_prepare</refname> <refname>mysqli->prepare()</refname> <refpurpose>Prepare a SQL statement for execution</refpurpose> </refnamediv> <refsect1 role="description"> &reftitle.description; <para>Procedure style:</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>Object oriented style (method)</para> <classsynopsis> <ooclass><classname>mysqli</classname></ooclass> <methodsynopsis> <type>mysqli_stmt</type><methodname>prepare</methodname> <methodparam><type>string</type><parameter>query</parameter></methodparam> </methodsynopsis> </classsynopsis> <para> Prepares the SQL query pointed to by the null-terminated string 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 Languange (DML) statements, and not in Data Defination 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 occured. </para> </refsect1> <refsect1 role="examples"> &reftitle.examples; <example> <title>Object oriented style</title> <programlisting role="php"> <![CDATA[ <?php $mysqli = new mysqli("localhost", "my_user", "my_password", "world"); /* check connection */ if (mysqli_connect_errno()) { printf("Connect failed: %s\n", mysqli_connect_error()); exit(); } $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> </example> <example> <title>Procedural style</title> <programlisting role="php"> <![CDATA[ <?php $link = mysqli_connect("localhost", "my_user", "my_password", "world"); /* check connection */ if (mysqli_connect_errno()) { printf("Connect failed: %s\n", mysqli_connect_error()); exit(); } $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> </example> &example.outputs; <screen> <![CDATA[ Amersfoort is in district Utrecht ]]> </screen> </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:"../../../../manual.ced" sgml-exposed-tags:nil sgml-local-catalogs:nil sgml-local-ecat-files:nil End: vim600: syn=xml fen fdm=syntax fdl=2 si vim: et tw=78 syn=sgml vi: ts=1 sw=1 --> http://cvs.php.net/viewvc.cgi/phpdoc/en/reference/mysqli/mysqli/query.xml?view=markup&rev=1.1 Index: phpdoc/en/reference/mysqli/mysqli/query.xml +++ phpdoc/en/reference/mysqli/mysqli/query.xml <?xml version="1.0" encoding="iso-8859-1"?> <!-- $Revision: 1.1 $ --> <refentry xml:id="function.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>Procedural style:</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>Object oriented style (method):</para> <classsynopsis> <ooclass><classname>mysqli</classname></ooclass> <methodsynopsis> <type>mixed</type><methodname>query</methodname> <methodparam><type>string</type><parameter>query</parameter></methodparam> <methodparam choice='opt'><type>int</type><parameter>resultmode</parameter></methodparam> </methodsynopsis> </classsynopsis> <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> </refsect1> <refsect1 role="parameters"> &reftitle.parameters; <para> <variablelist> &mysqli.link.description; <varlistentry> <term><parameter>query</parameter></term> <listitem> <para> The query string. </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> </listitem> </varlistentry> </variablelist> </para> </refsect1> <refsect1 role="returnvalues"> &reftitle.returnvalues; <para> &return.success; For <literal>SELECT, SHOW, DESCRIBE</literal> or <literal>EXPLAIN</literal> <function>mysqli_query</function> will return a result object. </para> </refsect1> <refsect1 role="examples"> &reftitle.examples; <example> <title>Object oriented style</title> <programlisting role="php"> <![CDATA[ <?php $mysqli = new mysqli("localhost", "my_user", "my_password", "world"); /* check connection */ if (mysqli_connect_errno()) { printf("Connect failed: %s\n", mysqli_connect_error()); exit(); } /* 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> </example> <example> <title>Procedural style</title> <programlisting role="php"> <![CDATA[ <?php $link = mysqli_connect("localhost", "my_user", "my_password", "world"); /* check connection */ if (mysqli_connect_errno()) { printf("Connect failed: %s\n", mysqli_connect_error()); exit(); } /* 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> </example> &example.outputs; <screen> <![CDATA[ Table myCity successfully created. Select returned 10 rows. Error: Commands out of sync; You can't run this command now ]]> </screen> </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:"../../../../manual.ced" sgml-exposed-tags:nil sgml-local-catalogs:nil sgml-local-ecat-files:nil End: vim600: syn=xml fen fdm=syntax fdl=2 si vim: et tw=78 syn=sgml vi: ts=1 sw=1 --> http://cvs.php.net/viewvc.cgi/phpdoc/en/reference/mysqli/mysqli/real-connect.xml?view=markup&rev=1.1 Index: phpdoc/en/reference/mysqli/mysqli/real-connect.xml +++ phpdoc/en/reference/mysqli/mysqli/real-connect.xml <?xml version="1.0" encoding="iso-8859-1"?> <!-- $Revision: 1.1 $ --> <refentry xml:id="function.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>Procedural style</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>Object oriented style (method)</para> <classsynopsis> <ooclass><classname>mysqli</classname></ooclass> <methodsynopsis> <type>bool</type><methodname>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> </classsynopsis> <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 function <function>mysqli_options</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>Object oriented style</title> <programlisting role="php"> <![CDATA[ <?php /* create a connection object which is not connected */ $mysqli = mysqli_init(); /* set connection options */ $mysqli->options(MYSQLI_INIT_COMMAND, "SET AUTOCOMMIT=0"); $mysqli->options(MYSQLI_OPT_CONNECT_TIMEOUT, 5); /* connect to server */ $mysqli->real_connect('localhost', 'my_user', 'my_password', 'world'); /* check connection */ if (mysqli_connect_errno()) { printf("Connect failed: %s\n", mysqli_connect_error()); exit(); } printf ("Connection: %s\n.", $mysqli->host_info); $mysqli->close(); ?> ]]> </programlisting> </example> <example> <title>Procedural style</title> <programlisting role="php"> <![CDATA[ <?php /* create a connection object which is not connected */ $link = mysqli_init(); /* set connection options */ mysqli_options($link, MYSQLI_INIT_COMMAND, "SET AUTOCOMMIT=0"); mysqli_options($link, MYSQLI_OPT_CONNECT_TIMEOUT, 5); /* connect to server */ mysqli_real_connect($link, 'localhost', 'my_user', 'my_password', 'world'); /* check connection */ if (mysqli_connect_errno()) { printf("Connect failed: %s\n", mysqli_connect_error()); exit(); } printf ("Connection: %s\n.", mysqli_get_host_info($link)); mysqli_close($link); ?> ]]> </programlisting> </example> &example.outputs; <screen> <![CDATA[ Connection: Localhost via UNIX socket ]]> </screen> </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:"../../../../manual.ced" sgml-exposed-tags:nil sgml-local-catalogs:nil sgml-local-ecat-files:nil End: vim600: syn=xml fen fdm=syntax fdl=2 si vim: et tw=78 syn=sgml vi: ts=1 sw=1 --> http://cvs.php.net/viewvc.cgi/phpdoc/en/reference/mysqli/mysqli/real-escape-string.xml?view=markup&rev=1.1 Index: phpdoc/en/reference/mysqli/mysqli/real-escape-string.xml +++ phpdoc/en/reference/mysqli/mysqli/real-escape-string.xml <?xml version="1.0" encoding="iso-8859-1"?> <!-- $Revision: 1.1 $ --> <refentry xml:id="function.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 a SQL statement, taking into account the current charset of the connection</refpurpose> </refnamediv> <refsect1 role="description"> &reftitle.description; <para>Procedural style:</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>Object oriented style (both methods are equivalent):</para> <classsynopsis> <ooclass><classname>mysqli</classname></ooclass> <methodsynopsis> <type>string</type><methodname>escape_string</methodname> <methodparam><type>string</type><parameter>escapestr</parameter></methodparam> </methodsynopsis> <methodsynopsis> <type>string</type><methodname>real_escape_string</methodname> <methodparam><type>string</type><parameter>escapestr</parameter></methodparam> </methodsynopsis> </classsynopsis> <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>Object oriented style</title> <programlisting role="php"> <![CDATA[ <?php $mysqli = new mysqli("localhost", "my_user", "my_password", "world"); /* check connection */ if (mysqli_connect_errno()) { printf("Connect failed: %s\n", mysqli_connect_error()); exit(); } $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> </example> <example> <title>Procedural style</title> <programlisting role="php"> <![CDATA[ <?php $link = mysqli_connect("localhost", "my_user", "my_password", "world"); /* check connection */ if (mysqli_connect_errno()) { printf("Connect failed: %s\n", mysqli_connect_error()); exit(); } 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> </example> &example.outputs; <screen> <![CDATA[ Error: 42000 1 Row inserted. ]]> </screen> </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:"../../../../manual.ced" sgml-exposed-tags:nil sgml-local-catalogs:nil sgml-local-ecat-files:nil End: vim600: syn=xml fen fdm=syntax fdl=2 si vim: et tw=78 syn=sgml vi: ts=1 sw=1 --> http://cvs.php.net/viewvc.cgi/phpdoc/en/reference/mysqli/mysqli/real-query.xml?view=markup&rev=1.1 Index: phpdoc/en/reference/mysqli/mysqli/real-query.xml +++ phpdoc/en/reference/mysqli/mysqli/real-query.xml <?xml version="1.0" encoding="iso-8859-1"?> <!-- $Revision: 1.1 $ --> <refentry xml:id="function.mysqli-real-query" xmlns="http://docbook.org/ns/docbook"> <refnamediv> <refname>mysqli_real_query</refname> <refname>mysqli->real_query()</refname> <refpurpose>Execute an SQL query</refpurpose> </refnamediv> <refsect1 role="description"> &reftitle.description; <para>Procedural style</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>Object oriented style (method):</para> <classsynopsis> <ooclass><classname>mysqli</classname></ooclass> <methodsynopsis> <type>bool</type><methodname>real_query</methodname> <methodparam><type>string</type><parameter>query</parameter></methodparam> </methodsynopsis> </classsynopsis> <para> Executes a single query against the database whose result can then be retrieved or stored using the <function>mysqli_store_result</function> or <function>mysqli_use_result</function> functions. </para> <para> In order to determine if a given query should return a result set or not, see <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> The query, as a string. </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:"../../../../manual.ced" sgml-exposed-tags:nil sgml-local-catalogs:nil sgml-local-ecat-files:nil End: vim600: syn=xml fen fdm=syntax fdl=2 si vim: et tw=78 syn=sgml vi: ts=1 sw=1 --> http://cvs.php.net/viewvc.cgi/phpdoc/en/reference/mysqli/mysqli/rollback.xml?view=markup&rev=1.1 Index: phpdoc/en/reference/mysqli/mysqli/rollback.xml +++ phpdoc/en/reference/mysqli/mysqli/rollback.xml <?xml version="1.0" encoding="iso-8859-1"?> <!-- $Revision: 1.1 $ --> <refentry xml:id="function.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; <methodsynopsis> <type>bool</type><methodname>mysqli_rollback</methodname> <methodparam><type>mysqli</type><parameter>link</parameter></methodparam> </methodsynopsis> <classsynopsis> <ooclass><classname>mysqli</classname></ooclass> <methodsynopsis> <type>bool</type><methodname>rollback</methodname> <void/> </methodsynopsis> </classsynopsis> <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>Object oriented style</title> <programlisting role="php"> <![CDATA[ <?php $mysqli = new mysqli("localhost", "my_user", "my_password", "world"); /* check connection */ if (mysqli_connect_errno()) { printf("Connect failed: %s\n", mysqli_connect_error()); exit(); } /* 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> </example> <example> <title>Procedural style</title> <programlisting role="php"> <![CDATA[ <?php $link = mysqli_connect("localhost", "my_user", "my_password", "world"); /* check connection */ if (mysqli_connect_errno()) { printf("Connect failed: %s\n", mysqli_connect_error()); exit(); } /* 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> </example> &example.outputs; <screen> <![CDATA[ 0 rows in table myCity. 50 rows in table myCity (after rollback). ]]> </screen> </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:"../../../../manual.ced" sgml-exposed-tags:nil sgml-local-catalogs:nil sgml-local-ecat-files:nil End: vim600: syn=xml fen fdm=syntax fdl=2 si vim: et tw=78 syn=sgml vi: ts=1 sw=1 --> http://cvs.php.net/viewvc.cgi/phpdoc/en/reference/mysqli/mysqli/select-db.xml?view=markup&rev=1.1 Index: phpdoc/en/reference/mysqli/mysqli/select-db.xml +++ phpdoc/en/reference/mysqli/mysqli/select-db.xml <?xml version="1.0" encoding="iso-8859-1"?> <!-- $Revision: 1.1 $ --> <refentry xml:id="function.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>Procedural style:</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>Object oriented style (method):</para> <classsynopsis> <ooclass><classname>mysqli</classname></ooclass> <methodsynopsis> <type>bool</type><methodname>select_db</methodname> <methodparam><type>string</type><parameter>dbname</parameter></methodparam> </methodsynopsis> </classsynopsis> <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>Object oriented style</title> <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> </example> <example> <title>Procedural style</title> <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> </example> &example.outputs; <screen> <![CDATA[ Default database is test. Default database is world. ]]> </screen> </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:"../../../../manual.ced" sgml-exposed-tags:nil sgml-local-catalogs:nil sgml-local-ecat-files:nil End: vim600: syn=xml fen fdm=syntax fdl=2 si vim: et tw=78 syn=sgml vi: ts=1 sw=1 --> http://cvs.php.net/viewvc.cgi/phpdoc/en/reference/mysqli/mysqli/set-charset.xml?view=markup&rev=1.1 Index: phpdoc/en/reference/mysqli/mysqli/set-charset.xml +++ phpdoc/en/reference/mysqli/mysqli/set-charset.xml <?xml version="1.0" encoding="iso-8859-1"?> <!-- $Revision: 1.1 $ --> <refentry xml:id="function.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>Procedural style:</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>Object oriented style (method):</para> <classsynopsis> <ooclass><classname>mysqli</classname></ooclass> <methodsynopsis> <type>bool</type><methodname>set_charset</methodname> <methodparam><type>string</type><parameter>charset</parameter></methodparam> </methodsynopsis> </classsynopsis> <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). It can be downloaded at <link xlink:href="&url.mysql.download.lib;">&url.mysql.download.lib;</link>. </para> </note> </refsect1> <refsect1 role="examples"> &reftitle.examples; <example> <title>Object oriented style</title> <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> </example> <example> <title>Procedural style</title> <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> </example> &example.outputs; <screen> <![CDATA[ Current character set: utf8 ]]> </screen> </refsect1> <refsect1 role="seealso"> &reftitle.seealso; <para> <simplelist> <member><function>mysqli_character_set_name</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:"../../../../manual.ced" sgml-exposed-tags:nil sgml-local-catalogs:nil sgml-local-ecat-files:nil End: vim600: syn=xml fen fdm=syntax fdl=2 si vim: et tw=78 syn=sgml vi: ts=1 sw=1 --> http://cvs.php.net/viewvc.cgi/phpdoc/en/reference/mysqli/mysqli/set-local-infile-default.xml?view=markup&rev=1.1 Index: phpdoc/en/reference/mysqli/mysqli/set-local-infile-default.xml +++ phpdoc/en/reference/mysqli/mysqli/set-local-infile-default.xml <?xml version="1.0" encoding="iso-8859-1"?> <!-- $Revision: 1.1 $ --> <refentry xml:id="function.mysqli-set-local-infile-default" xmlns="http://docbook.org/ns/docbook"> <refnamediv> <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> &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:"../../../../manual.ced" sgml-exposed-tags:nil sgml-local-catalogs:nil sgml-local-ecat-files:nil End: vim600: syn=xml fen fdm=syntax fdl=2 si vim: et tw=78 syn=sgml vi: ts=1 sw=1 --> http://cvs.php.net/viewvc.cgi/phpdoc/en/reference/mysqli/mysqli/set-local-infile-handler.xml?view=markup&rev=1.1 Index: phpdoc/en/reference/mysqli/mysqli/set-local-infile-handler.xml +++ phpdoc/en/reference/mysqli/mysqli/set-local-infile-handler.xml <?xml version="1.0" encoding="iso-8859-1"?> <!-- $Revision: 1.1 $ --> <refentry xml:id="function.mysqli-set-local-infile-handler" xmlns="http://docbook.org/ns/docbook"> <refnamediv> <refname>mysqli_set_local_infile_handler</refname> <refpurpose>Set callback functions for LOAD DATA LOCAL INFILE command</refpurpose> </refnamediv> <refsect1 role="description"> &reftitle.description; <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> &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:"../../../../manual.ced" sgml-exposed-tags:nil sgml-local-catalogs:nil sgml-local-ecat-files:nil End: vim600: syn=xml fen fdm=syntax fdl=2 si vim: et tw=78 syn=sgml vi: ts=1 sw=1 --> http://cvs.php.net/viewvc.cgi/phpdoc/en/reference/mysqli/mysqli/sqlstate.xml?view=markup&rev=1.1 Index: phpdoc/en/reference/mysqli/mysqli/sqlstate.xml +++ phpdoc/en/reference/mysqli/mysqli/sqlstate.xml <?xml version="1.0" encoding="iso-8859-1"?> <!-- $Revision: 1.1 $ --> <refentry xml:id="function.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>Procedural style:</para> <methodsynopsis> <type>string</type><methodname>mysqli_sqlstate</methodname> <methodparam><type>mysqli</type><parameter>link</parameter></methodparam> </methodsynopsis> <para>Object oriented style (property):</para> <classsynopsis> <ooclass><classname>mysqli</classname></ooclass> <fieldsynopsis><type>string</type><varname>sqlstate</varname></fieldsynopsis> </classsynopsis> <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>Object oriented style</title> <programlisting role="php"> <![CDATA[ <?php $mysqli = new mysqli("localhost", "my_user", "my_password", "world"); /* check connection */ if (mysqli_connect_errno()) { printf("Connect failed: %s\n", mysqli_connect_error()); exit(); } /* 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> </example> <example> <title>Procedural style</title> <programlisting role="php"> <![CDATA[ <?php $link = mysqli_connect("localhost", "my_user", "my_password", "world"); /* check connection */ if (mysqli_connect_errno()) { printf("Connect failed: %s\n", mysqli_connect_error()); exit(); } /* 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> </example> &example.outputs; <screen> <![CDATA[ Error - SQLSTATE 42S01. ]]> </screen> </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:"../../../../manual.ced" sgml-exposed-tags:nil sgml-local-catalogs:nil sgml-local-ecat-files:nil End: vim600: syn=xml fen fdm=syntax fdl=2 si vim: et tw=78 syn=sgml vi: ts=1 sw=1 --> http://cvs.php.net/viewvc.cgi/phpdoc/en/reference/mysqli/mysqli/ssl-set.xml?view=markup&rev=1.1 Index: phpdoc/en/reference/mysqli/mysqli/ssl-set.xml +++ phpdoc/en/reference/mysqli/mysqli/ssl-set.xml <?xml version="1.0" encoding="iso-8859-1"?> <!-- $Revision: 1.1 $ --> <refentry xml:id="function.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>Procedural style:</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>Object oriented style (method):</para> <classsynopsis> <ooclass><classname>mysqli</classname></ooclass> <methodsynopsis> <type>bool</type><methodname>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> </classsynopsis> <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> </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:"../../../../manual.ced" sgml-exposed-tags:nil sgml-local-catalogs:nil sgml-local-ecat-files:nil End: vim600: syn=xml fen fdm=syntax fdl=2 si vim: et tw=78 syn=sgml vi: ts=1 sw=1 --> http://cvs.php.net/viewvc.cgi/phpdoc/en/reference/mysqli/mysqli/stat.xml?view=markup&rev=1.1 Index: phpdoc/en/reference/mysqli/mysqli/stat.xml +++ phpdoc/en/reference/mysqli/mysqli/stat.xml <?xml version="1.0" encoding="iso-8859-1"?> <!-- $Revision: 1.1 $ --> <refentry xml:id="function.mysqli-stat" xmlns="http://docbook.org/ns/docbook"> <refnamediv> <refname>mysqli_stat</refname> <refname>mysqli->stat()</refname> <refpurpose>Gets the current system status</refpurpose> </refnamediv> <refsect1 role="description"> &reftitle.description; <para>Procedural style:</para> <methodsynopsis> <type>string</type><methodname>mysqli_stat</methodname> <methodparam><type>mysqli</type><parameter>link</parameter></methodparam> </methodsynopsis> <para>Object oriented style (method):</para> <classsynopsis> <ooclass><classname>mysqli</classname></ooclass> <methodsynopsis> <type>string</type><methodname>stat</methodname> <void /> </methodsynopsis> </classsynopsis> <para> <function>mysqli_stat</function> returns a string containing information similar to that provided by the 'mysqladmin status' command. This includes uptime in seconds and the number of running threads, questions, reloads, and open tables. </para> </refsect1> <refsect1 role="parameters"> &reftitle.parameters; <para> <variablelist> &mysqli.link.description; </variablelist> </para> </refsect1> <refsect1 role="returnvalues"> &reftitle.returnvalues; <para> A string describing the server status. &false; if an error occurred. </para> </refsect1> <refsect1 role="examples"> &reftitle.examples; <example> <title>Object oriented style</title> <programlisting role="php"> <![CDATA[ <?php $mysqli = new mysqli("localhost", "my_user", "my_password", "world"); /* check connection */ if (mysqli_connect_errno()) { printf("Connect failed: %s\n", mysqli_connect_error()); exit(); } printf ("System status: %s\n", $mysqli->stat()); $mysqli->close(); ?> ]]> </programlisting> </example> <example> <title>Procedural style</title> <programlisting role="php"> <![CDATA[ <?php $link = mysqli_connect("localhost", "my_user", "my_password", "world"); /* check connection */ if (mysqli_connect_errno()) { printf("Connect failed: %s\n", mysqli_connect_error()); exit(); } printf("System status: %s\n", mysqli_stat($link)); mysqli_close($link); ?> ]]> </programlisting> </example> &example.outputs; <screen> <![CDATA[ System status: Uptime: 272 Threads: 1 Questions: 5340 Slow queries: 0 Opens: 13 Flush tables: 1 Open tables: 0 Queries per second avg: 19.632 Memory in use: 8496K Max memory used: 8560K ]]> </screen> </refsect1> <refsect1 role="seealso"> &reftitle.seealso; <para> <simplelist> <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:"../../../../manual.ced" sgml-exposed-tags:nil sgml-local-catalogs:nil sgml-local-ecat-files:nil End: vim600: syn=xml fen fdm=syntax fdl=2 si vim: et tw=78 syn=sgml vi: ts=1 sw=1 --> http://cvs.php.net/viewvc.cgi/phpdoc/en/reference/mysqli/mysqli/stmt-init.xml?view=markup&rev=1.1 Index: phpdoc/en/reference/mysqli/mysqli/stmt-init.xml +++ phpdoc/en/reference/mysqli/mysqli/stmt-init.xml <?xml version="1.0" encoding="iso-8859-1"?> <!-- $Revision: 1.1 $ --> <refentry xml:id="function.mysqli-stmt-init" xmlns="http://docbook.org/ns/docbook"> <refnamediv> <refname>mysqli_stmt_init</refname> <refname>mysqli->stmt_init()</refname> <refpurpose>Initializes a statement and returns an object for use with mysqli_stmt_prepare</refpurpose> </refnamediv> <refsect1 role="description"> &reftitle.description; <para>Procedural style :</para> <methodsynopsis> <type>mysqli_stmt</type><methodname>mysqli_stmt_init</methodname> <methodparam><type>mysqli</type><parameter>link</parameter></methodparam> </methodsynopsis> <para>Object oriented style (property):</para> <classsynopsis> <ooclass><classname>mysqli</classname></ooclass> <methodsynopsis> <type>mysqli_stmt</type><methodname>stmt_init</methodname> <void/> </methodsynopsis> </classsynopsis> <para> Allocates and initializes a statement object suitable for <function>mysqli_stmt_prepare</function>. </para> <note> <para> Any subsequent calls to any mysqli_stmt function will fail until <function>mysqli_stmt_prepare</function> was called. </para> </note> </refsect1> <refsect1 role="parameters"> &reftitle.parameters; <para> <variablelist> &mysqli.link.description; </variablelist> </para> </refsect1> <refsect1 role="returnvalues"> &reftitle.returnvalues; <para> Returns an object. </para> </refsect1> <refsect1 role="seealso"> &reftitle.seealso; <para> <simplelist> <member><function>mysqli_stmt_prepare</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:"../../../../manual.ced" sgml-exposed-tags:nil sgml-local-catalogs:nil sgml-local-ecat-files:nil End: vim600: syn=xml fen fdm=syntax fdl=2 si vim: et tw=78 syn=sgml vi: ts=1 sw=1 --> http://cvs.php.net/viewvc.cgi/phpdoc/en/reference/mysqli/mysqli/store-result.xml?view=markup&rev=1.1 Index: phpdoc/en/reference/mysqli/mysqli/store-result.xml +++ phpdoc/en/reference/mysqli/mysqli/store-result.xml <?xml version="1.0" encoding="iso-8859-1"?> <!-- $Revision: 1.1 $ --> <refentry xml:id="function.mysqli-store-result" xmlns="http://docbook.org/ns/docbook"> <refnamediv> <refname>mysqli_store_result</refname> <refname>mysqli->store_result()</refname> <refpurpose>Transfers a result set from the last query</refpurpose> </refnamediv> <refsect1 role="description"> &reftitle.description; <para>Procedural style:</para> <methodsynopsis> <type>mysqli_result</type><methodname>mysqli_store_result</methodname> <methodparam><type>mysqli</type><parameter>link</parameter></methodparam> </methodsynopsis> <para>Object oriented style (method):</para> <classsynopsis> <ooclass><classname>mysqli</classname></ooclass> <methodsynopsis> <type>mysqli_result</type><methodname>store_result</methodname> <void /> </methodsynopsis> </classsynopsis> <para> Transfers the result set from the last query on the database connection represented by the <parameter>link</parameter> parameter to be used with the <function>mysqli_data_seek</function> function. </para> </refsect1> <refsect1 role="parameters"> &reftitle.parameters; <para> <variablelist> &mysqli.link.description; </variablelist> </para> </refsect1> <refsect1 role="returnvalues"> &reftitle.returnvalues; <para> Returns a buffered result object or &false; if an error occurred. </para> <note> <para> <function>mysqli_store_result</function> returns &false; in case the query didn't return a result set (if the query was, for example an INSERT statement). This function also returns &false; if the reading of the result set failed. You can check if you have got an error by checking if <function>mysqli_error</function> doesn't return an empty string, if <function>mysqli_errno</function> returns a non zero value, or if <function>mysqli_field_count</function> returns a non zero value. Also possible reason for this function returning &false; after successfull call to <function>mysqli_query</function> can be too large result set (memory for it cannot be allocated). If <function>mysqli_field_count</function> returns a non-zero value, the statement should have produced a non-empty result set. </para> </note> </refsect1> <refsect1 role="notes"> &reftitle.notes; <note> <para> Although it is always good practice to free the memory used by the result of a query using the <function>mysqli_free_result</function> function, when transfering large result sets using the <function>mysqli_store_result</function> this becomes particularly important. </para> </note> </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_real_query</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:"../../../../manual.ced" sgml-exposed-tags:nil sgml-local-catalogs:nil sgml-local-ecat-files:nil End: vim600: syn=xml fen fdm=syntax fdl=2 si vim: et tw=78 syn=sgml vi: ts=1 sw=1 --> http://cvs.php.net/viewvc.cgi/phpdoc/en/reference/mysqli/mysqli/thread-id.xml?view=markup&rev=1.1 Index: phpdoc/en/reference/mysqli/mysqli/thread-id.xml +++ phpdoc/en/reference/mysqli/mysqli/thread-id.xml <?xml version="1.0" encoding="iso-8859-1"?> <!-- $Revision: 1.1 $ --> <refentry xml:id="function.mysqli-thread-id" xmlns="http://docbook.org/ns/docbook"> <refnamediv> <refname>mysqli_thread_id</refname> <refname>mysqli->thread_id</refname> <refpurpose>Returns the thread ID for the current connection</refpurpose> </refnamediv> <refsect1 role="description"> &reftitle.description; <para>Procedural style:</para> <methodsynopsis> <type>int</type><methodname>mysqli_thread_id</methodname> <methodparam><type>mysqli</type><parameter>link</parameter></methodparam> </methodsynopsis> <para>Object oriented style (property):</para> <classsynopsis> <ooclass><classname>mysqli</classname></ooclass> <fieldsynopsis><type>int</type><varname>thread_id</varname></fieldsynopsis> </classsynopsis> <para> The <function>mysqli_thread_id</function> function returns the thread ID for the current connection which can then be killed using the <function>mysqli_kill</function> function. If the connection is lost and you reconnect with <function>mysqli_ping</function>, the thread ID will be other. Therefore you should get the thread ID only when you need it. </para> <note> <para> The thread ID is assigned on a connection-by-connection basis. Hence, if the connection is broken and then re-established a new thread ID will be assigned. </para> <para> To kill a running query you can use the SQL command <literal>KILL QUERY processid</literal>. </para> </note> </refsect1> <refsect1 role="parameters"> &reftitle.parameters; <para> <variablelist> &mysqli.link.description; </variablelist> </para> </refsect1> <refsect1 role="returnvalues"> &reftitle.returnvalues; <para> Returns the Thread ID for the current connection. </para> </refsect1> <refsect1 role="examples"> &reftitle.examples; <example> <title>Object oriented style</title> <programlisting role="php"> <![CDATA[ <?php $mysqli = new mysqli("localhost", "my_user", "my_password", "world"); /* check connection */ if (mysqli_connect_errno()) { printf("Connect failed: %s\n", mysqli_connect_error()); exit(); } /* determine our thread id */ $thread_id = $mysqli->thread_id; /* Kill connection */ $mysqli->kill($thread_id); /* This should produce an error */ if (!$mysqli->query("CREATE TABLE myCity LIKE City")) { printf("Error: %s\n", $mysqli->error); exit; } /* close connection */ $mysqli->close(); ?> ]]> </programlisting> </example> <example> <title>Procedural style</title> <programlisting role="php"> <![CDATA[ <?php $link = mysqli_connect("localhost", "my_user", "my_password", "world"); /* check connection */ if (mysqli_connect_errno()) { printf("Connect failed: %s\n", mysqli_connect_error()); exit(); } /* determine our thread id */ $thread_id = mysqli_thread_id($link); /* Kill connection */ mysqli_kill($link, $thread_id); /* This should produce an error */ if (!mysqli_query($link, "CREATE TABLE myCity LIKE City")) { printf("Error: %s\n", mysqli_error($link)); exit; } /* close connection */ mysqli_close($link); ?> ]]> </programlisting> </example> &example.outputs; <screen> <![CDATA[ Error: MySQL server has gone away ]]> </screen> </refsect1> <refsect1 role="seealso"> &reftitle.seealso; <para> <simplelist> <member><function>mysqli_kill</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:"../../../../manual.ced" sgml-exposed-tags:nil sgml-local-catalogs:nil sgml-local-ecat-files:nil End: vim600: syn=xml fen fdm=syntax fdl=2 si vim: et tw=78 syn=sgml vi: ts=1 sw=1 --> http://cvs.php.net/viewvc.cgi/phpdoc/en/reference/mysqli/mysqli/thread-safe.xml?view=markup&rev=1.1 Index: phpdoc/en/reference/mysqli/mysqli/thread-safe.xml +++ phpdoc/en/reference/mysqli/mysqli/thread-safe.xml <?xml version="1.0" encoding="iso-8859-1"?> <!-- $Revision: 1.1 $ --> <refentry xml:id="function.mysqli-thread-safe" xmlns="http://docbook.org/ns/docbook"> <refnamediv> <refname>mysqli_thread_safe</refname> <refpurpose>Returns whether thread safety is given or not</refpurpose> </refnamediv> <refsect1 role="description"> &reftitle.description; <para>Procedural style:</para> <methodsynopsis> <type>bool</type><methodname>mysqli_thread_safe</methodname> <void /> </methodsynopsis> <para> Tells whether the client library is compiled as thread-safe. </para> </refsect1> <refsect1 role="returnvalues"> &reftitle.returnvalues; <para> &true; if the client library is thread-safe, otherwise &false;. </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:"../../../../manual.ced" sgml-exposed-tags:nil sgml-local-catalogs:nil sgml-local-ecat-files:nil End: vim600: syn=xml fen fdm=syntax fdl=2 si vim: et tw=78 syn=sgml vi: ts=1 sw=1 --> http://cvs.php.net/viewvc.cgi/phpdoc/en/reference/mysqli/mysqli/use-result.xml?view=markup&rev=1.1 Index: phpdoc/en/reference/mysqli/mysqli/use-result.xml +++ phpdoc/en/reference/mysqli/mysqli/use-result.xml <?xml version="1.0" encoding="iso-8859-1"?> <!-- $Revision: 1.1 $ --> <refentry xml:id="function.mysqli-use-result" xmlns="http://docbook.org/ns/docbook"> <refnamediv> <refname>mysqli_use_result</refname> <refname>mysqli->use_result()</refname> <refpurpose>Initiate a result set retrieval</refpurpose> </refnamediv> <refsect1 role="description"> &reftitle.description; <para>Procedural style:</para> <methodsynopsis> <type>mysqli_result</type><methodname>mysqli_use_result</methodname> <methodparam><type>mysqli</type><parameter>link</parameter></methodparam> </methodsynopsis> <para>Object oriented style (method):</para> <classsynopsis> <ooclass><classname>mysqli</classname></ooclass> <methodsynopsis> <type>mysqli_result</type><methodname>use_result</methodname> <void /> </methodsynopsis> </classsynopsis> <para> Used to initiate the retrieval of a result set from the last query executed using the <function>mysqli_real_query</function> function on the database connection. </para> <para> Either this or the <function>mysqli_store_result</function> function must be called before the results of a query can be retrieved, and one or the other must be called to prevent the next query on that database connection from failing. </para> <note> <para> The <function>mysqli_use_result</function> function does not transfer the entire result set from the database and hence cannot be used functions such as <function>mysqli_data_seek</function> to move to a particular row within the set. To use this functionality, the result set must be stored using <function>mysqli_store_result</function>. One should not use <function>mysqli_use_result</function> if a lot of processing on the client side is performed, since this will tie up the server and prevent other threads from updating any tables from which the data is being fetched. </para> </note> </refsect1> <refsect1 role="returnvalues"> &reftitle.returnvalues; <para> Returns an unbuffered result object or &false; if an error occurred. </para> </refsect1> <refsect1 role="examples"> &reftitle.examples; <example> <title>Object oriented style</title> <programlisting role="php"> <![CDATA[ <?php $mysqli = new mysqli("localhost", "my_user", "my_password", "world"); /* check connection */ if (mysqli_connect_errno()) { printf("Connect failed: %s\n", mysqli_connect_error()); exit(); } $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->use_result()) { while ($row = $result->fetch_row()) { printf("%s\n", $row[0]); } $result->close(); } /* print divider */ if ($mysqli->more_results()) { printf("-----------------\n"); } } while ($mysqli->next_result()); } /* close connection */ $mysqli->close(); ?> ]]> </programlisting> </example> <example> <title>Procedural style</title> <programlisting role="php"> <![CDATA[ <?php $link = mysqli_connect("localhost", "my_user", "my_password", "world"); /* check connection */ if (mysqli_connect_errno()) { printf("Connect failed: %s\n", mysqli_connect_error()); exit(); } $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_use_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> </example> &example.outputs; <screen> <![CDATA[ my_user@localhost ----------------- Amersfoort Maastricht Dordrecht Leiden Haarlemmermeer ]]> </screen> </refsect1> <refsect1 role="seealso"> &reftitle.seealso; <para> <simplelist> <member><function>mysqli_real_query</function></member> <member><function>mysqli_store_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:"../../../../manual.ced" sgml-exposed-tags:nil sgml-local-catalogs:nil sgml-local-ecat-files:nil End: vim600: syn=xml fen fdm=syntax fdl=2 si vim: et tw=78 syn=sgml vi: ts=1 sw=1 --> http://cvs.php.net/viewvc.cgi/phpdoc/en/reference/mysqli/mysqli/warning-count.xml?view=markup&rev=1.1 Index: phpdoc/en/reference/mysqli/mysqli/warning-count.xml +++ phpdoc/en/reference/mysqli/mysqli/warning-count.xml <?xml version="1.0" encoding="iso-8859-1"?> <!-- $Revision: 1.1 $ --> <refentry xml:id="function.mysqli-warning-count" xmlns="http://docbook.org/ns/docbook"> <refnamediv> <refname>mysqli_warning_count</refname> <refname>mysqli->warning_count</refname> <refpurpose>Returns the number of warnings from the last query for the given link</refpurpose> </refnamediv> <refsect1 role="description"> &reftitle.description; <para>Procedural style:</para> <methodsynopsis> <type>int</type><methodname>mysqli_warning_count</methodname> <methodparam><type>mysqli</type><parameter>link</parameter></methodparam> </methodsynopsis> <para>Object oriented style (property):</para> <classsynopsis> <ooclass><classname>mysqli</classname></ooclass> <fieldsynopsis><type>int</type><varname>warning_count</varname></fieldsynopsis> </classsynopsis> <para> Returns the number of warnings from the last query in the connection. </para> <note> <para> For retrieving warning messages you can use the SQL command <literal>SHOW WARNINGS [limit row_count]</literal>. </para> </note> </refsect1> <refsect1 role="parameters"> &reftitle.parameters; <para> <variablelist> &mysqli.link.description; </variablelist> </para> </refsect1> <refsect1 role="returnvalues"> &reftitle.returnvalues; <para> Number of warnings or zero if there are no warnings. </para> </refsect1> <refsect1 role="examples"> &reftitle.examples; <example> <title>Object oriented style</title> <programlisting role="php"> <![CDATA[ <?php $mysqli = new mysqli("localhost", "my_user", "my_password", "world"); /* check connection */ if (mysqli_connect_errno()) { printf("Connect failed: %s\n", mysqli_connect_error()); exit(); } $mysqli->query("CREATE TABLE myCity LIKE City"); /* a remarkable city in Wales */ $query = "INSERT INTO myCity (CountryCode, Name) VALUES('GBR', 'Llanfairpwllgwyngyllgogerychwyrndrobwllllantysiliogogogoch')"; $mysqli->query($query); if ($mysqli->warning_count) { if ($result = $mysqli->query("SHOW WARNINGS")) { $row = $result->fetch_row(); printf("%s (%d): %s\n", $row[0], $row[1], $row[2]); $result->close(); } } /* close connection */ $mysqli->close(); ?> ]]> </programlisting> </example> <example> <title>Procedural style</title> <programlisting role="php"> <![CDATA[ <?php $link = mysqli_connect("localhost", "my_user", "my_password", "world"); /* check connection */ if (mysqli_connect_errno()) { printf("Connect failed: %s\n", mysqli_connect_error()); exit(); } mysqli_query($link, "CREATE TABLE myCity LIKE City"); /* a remarkable long city name in Wales */ $query = "INSERT INTO myCity (CountryCode, Name) VALUES('GBR', 'Llanfairpwllgwyngyllgogerychwyrndrobwllllantysiliogogogoch')"; mysqli_query($link, $query); if (mysqli_warning_count($link)) { if ($result = mysqli_query($link, "SHOW WARNINGS")) { $row = mysqli_fetch_row($result); printf("%s (%d): %s\n", $row[0], $row[1], $row[2]); mysqli_free_result($result); } } /* close connection */ mysqli_close($link); ?> ]]> </programlisting> </example> &example.outputs; <screen> <![CDATA[ Warning (1264): Data truncated for column 'Name' at row 1 ]]> </screen> </refsect1> <refsect1 role="seealso"> &reftitle.seealso; <para> <simplelist> <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:"../../../../manual.ced" sgml-exposed-tags:nil sgml-local-catalogs:nil sgml-local-ecat-files:nil End: vim600: syn=xml fen fdm=syntax fdl=2 si vim: et tw=78 syn=sgml vi: ts=1 sw=1 -->
http://cvs.php.net/viewvc.cgi/phpdoc/en/reference/mysqli/mysqli.xml?r1=1.3&r2=1.4&diff_format=u Index: phpdoc/en/reference/mysqli/mysqli.xml diff -u phpdoc/en/reference/mysqli/mysqli.xml:1.3 phpdoc/en/reference/mysqli/mysqli.xml:1.4 --- phpdoc/en/reference/mysqli/mysqli.xml:1.3 Wed Dec 26 18:56:29 2007 +++ phpdoc/en/reference/mysqli/mysqli.xml Wed Jan 2 14:38:32 2008 @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="utf-8"?> -<!-- $Revision: 1.3 $ --> +<!-- $Revision: 1.4 $ --> <reference xml:id="class.mysqli" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:xi="http://www.w3.org/2001/XInclude"> <title>The MySQLi class</title> <titleabbrev>MySQLi</titleabbrev> @@ -42,71 +42,8 @@ </partintro> -<!-- &reference.mysqli.entities.mysqli; --> -<!-- {{{ FIXME: These entities should be removed and the one above used --> - &reference.mysqli.functions.mysqli-autocommit; - &reference.mysqli.functions.mysqli-change-user; - &reference.mysqli.functions.mysqli-character-set-name; - &reference.mysqli.functions.mysqli-client-encoding; - &reference.mysqli.functions.mysqli-close; - &reference.mysqli.functions.mysqli-commit; - &reference.mysqli.functions.mysqli-connect; - &reference.mysqli.functions.mysqli-debug; - &reference.mysqli.functions.mysqli-disable-reads-from-master; - &reference.mysqli.functions.mysqli-disable-rpl-parse; - &reference.mysqli.functions.mysqli-dump-debug-info; - &reference.mysqli.functions.mysqli-enable-reads-from-master; - &reference.mysqli.functions.mysqli-enable-rpl-parse; - &reference.mysqli.functions.mysqli-get-client-info; - &reference.mysqli.functions.mysqli-get-server-info; - &reference.mysqli.functions.mysqli-get-warnings; - &reference.mysqli.functions.mysqli-init; - &reference.mysqli.functions.mysqli-kill; - &reference.mysqli.functions.mysqli-set-local-infile-default; - &reference.mysqli.functions.mysqli-set-local-infile-handler; - &reference.mysqli.functions.mysqli-master-query; - &reference.mysqli.functions.mysqli-multi-query; - &reference.mysqli.functions.mysqli-more-results; - &reference.mysqli.functions.mysqli-next-result; - &reference.mysqli.functions.mysqli-options; - &reference.mysqli.functions.mysqli-ping; - &reference.mysqli.functions.mysqli-prepare; - &reference.mysqli.functions.mysqli-query; - &reference.mysqli.functions.mysqli-real-connect; - &reference.mysqli.functions.mysqli-real-escape-string; - &reference.mysqli.functions.mysqli-escape-string; - &reference.mysqli.functions.mysqli-real-query; - &reference.mysqli.functions.mysqli-rollback; - &reference.mysqli.functions.mysqli-rpl-parse-enabled; - &reference.mysqli.functions.mysqli-rpl-probe; - &reference.mysqli.functions.mysqli-rpl-query-type; - &reference.mysqli.functions.mysqli-select-db; - &reference.mysqli.functions.mysqli-set-charset; - &reference.mysqli.functions.mysqli-set-opt; - &reference.mysqli.functions.mysqli-slave-query; - &reference.mysqli.functions.mysqli-ssl-set; - &reference.mysqli.functions.mysqli-stat; - &reference.mysqli.functions.mysqli-stmt-init; - &reference.mysqli.functions.mysqli-store-result; - &reference.mysqli.functions.mysqli-thread-safe; - &reference.mysqli.functions.mysqli-use-result; + &reference.mysqli.entities.mysqli; - - &reference.mysqli.functions.mysqli-get-host-info; - &reference.mysqli.functions.mysqli-get-server-version; - &reference.mysqli.functions.mysqli-info; - &reference.mysqli.functions.mysqli-affected-rows; - &reference.mysqli.functions.mysqli-get-client-version; - &reference.mysqli.functions.mysqli-errno; - &reference.mysqli.functions.mysqli-error; - &reference.mysqli.functions.mysqli-field-count; - &reference.mysqli.functions.mysqli-insert-id; - &reference.mysqli.functions.mysqli-get-proto-info; - &reference.mysqli.functions.mysqli-sqlstate; - &reference.mysqli.functions.mysqli-thread-id; - &reference.mysqli.functions.mysqli-warning-count; -<!-- }}} --> - </reference> <!-- Keep this comment at the end of the file http://cvs.php.net/viewvc.cgi/phpdoc/en/reference/mysqli/mysqli/affected-rows.xml?view=markup&rev=1.1 Index: phpdoc/en/reference/mysqli/mysqli/affected-rows.xml +++ phpdoc/en/reference/mysqli/mysqli/affected-rows.xml <?xml version="1.0" encoding="iso-8859-1"?> <!-- $Revision: 1.1 $ --> <refentry xml:id="function.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>Procedural style:</para> <methodsynopsis> <type>int</type><methodname>mysqli_affected_rows</methodname> <methodparam><type>mysqli</type><parameter>link</parameter></methodparam> </methodsynopsis> <para>Object oriented style (property):</para> <classsynopsis> <ooclass><classname>mysqli</classname></ooclass> <fieldsynopsis><type>int</type><varname>affected_rows</varname></fieldsynopsis> </classsynopsis> <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>Object oriented style</title> <programlisting role="php"> <![CDATA[ <?php $mysqli = new mysqli("localhost", "my_user", "my_password", "world"); /* check connection */ if (mysqli_connect_errno()) { printf("Connect failed: %s\n", mysqli_connect_error()); exit(); } /* 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> </example> <example> <title>Procedural style</title> <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> </example> &example.outputs; <screen> <![CDATA[ Affected rows (INSERT): 984 Affected rows (UPDATE): 168 Affected rows (DELETE): 815 Affected rows (SELECT): 169 ]]> </screen> </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:"../../../../manual.ced" sgml-exposed-tags:nil sgml-local-catalogs:nil sgml-local-ecat-files:nil End: vim600: syn=xml fen fdm=syntax fdl=2 si vim: et tw=78 syn=sgml vi: ts=1 sw=1 --> http://cvs.php.net/viewvc.cgi/phpdoc/en/reference/mysqli/mysqli/autocommit.xml?view=markup&rev=1.1 Index: phpdoc/en/reference/mysqli/mysqli/autocommit.xml +++ phpdoc/en/reference/mysqli/mysqli/autocommit.xml <?xml version="1.0" encoding="iso-8859-1"?> <!-- $Revision: 1.1 $ --> <refentry xml:id="function.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>Procedural style:</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>Object oriented style (method)</para> <classsynopsis> <ooclass><classname>mysqli</classname></ooclass> <methodsynopsis> <type>bool</type><methodname>autocommit</methodname> <methodparam><type>bool</type><parameter>mode</parameter></methodparam> </methodsynopsis> </classsynopsis> <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>Object oriented style</title> <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> </example> <example> <title>Procedural style</title> <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> </example> &example.outputs; <screen> <![CDATA[ Autocommit is 1 ]]> </screen> </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:"../../../../manual.ced" sgml-exposed-tags:nil sgml-local-catalogs:nil sgml-local-ecat-files:nil End: vim600: syn=xml fen fdm=syntax fdl=2 si vim: et tw=78 syn=sgml vi: ts=1 sw=1 --> http://cvs.php.net/viewvc.cgi/phpdoc/en/reference/mysqli/mysqli/change-user.xml?view=markup&rev=1.1 Index: phpdoc/en/reference/mysqli/mysqli/change-user.xml +++ phpdoc/en/reference/mysqli/mysqli/change-user.xml <?xml version="1.0" encoding="iso-8859-1"?> <!-- $Revision: 1.1 $ --> <refentry xml:id="function.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>Procedural style:</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>Object oriented style (method):</para> <classsynopsis> <ooclass><classname>mysqli</classname></ooclass> <methodsynopsis> <type>bool</type><methodname>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> </classsynopsis> <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>Object oriented style</title> <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> </example> <example> <title>Procedural style</title> <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> </example> &example.outputs; <screen> <![CDATA[ Default database: world Value of variable a is NULL ]]> </screen> </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:"../../../../manual.ced" sgml-exposed-tags:nil sgml-local-catalogs:nil sgml-local-ecat-files:nil End: vim600: syn=xml fen fdm=syntax fdl=2 si vim: et tw=78 syn=sgml vi: ts=1 sw=1 --> http://cvs.php.net/viewvc.cgi/phpdoc/en/reference/mysqli/mysqli/character-set-name.xml?view=markup&rev=1.1 Index: phpdoc/en/reference/mysqli/mysqli/character-set-name.xml +++ phpdoc/en/reference/mysqli/mysqli/character-set-name.xml <?xml version="1.0" encoding="iso-8859-1"?> <!-- $Revision: 1.1 $ --> <refentry xml:id="function.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>Procedural style:</para> <methodsynopsis> <type>string</type><methodname>mysqli_character_set_name</methodname> <methodparam><type>mysqli</type><parameter>link</parameter></methodparam> </methodsynopsis> <para>Object oriented style (method):</para> <classsynopsis> <ooclass><classname>mysqli</classname></ooclass> <methodsynopsis> <type>string</type><methodname>character_set_name</methodname> <void /> </methodsynopsis> </classsynopsis> <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>Object oriented style</title> <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> </example> <example> <title>Procedural style</title> <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> </example> &example.outputs; <screen> <![CDATA[ Current character set is latin1_swedish_ci ]]> </screen> </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:"../../../../manual.ced" sgml-exposed-tags:nil sgml-local-catalogs:nil sgml-local-ecat-files:nil End: vim600: syn=xml fen fdm=syntax fdl=2 si vim: et tw=78 syn=sgml vi: ts=1 sw=1 --> http://cvs.php.net/viewvc.cgi/phpdoc/en/reference/mysqli/mysqli/close.xml?view=markup&rev=1.1 Index: phpdoc/en/reference/mysqli/mysqli/close.xml +++ phpdoc/en/reference/mysqli/mysqli/close.xml <?xml version="1.0" encoding="iso-8859-1"?> <!-- $Revision: 1.1 $ --> <refentry xml:id="function.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>Procedural style:</para> <methodsynopsis> <type>bool</type><methodname>mysqli_close</methodname> <methodparam><type>mysqli</type><parameter>link</parameter></methodparam> </methodsynopsis> <para>Object oriented style (method):</para> <classsynopsis> <ooclass><classname>mysqli</classname></ooclass> <methodsynopsis> <type>bool</type><methodname>close</methodname> <void /> </methodsynopsis> </classsynopsis> <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="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:"../../../../manual.ced" sgml-exposed-tags:nil sgml-local-catalogs:nil sgml-local-ecat-files:nil End: vim600: syn=xml fen fdm=syntax fdl=2 si vim: et tw=78 syn=sgml vi: ts=1 sw=1 --> http://cvs.php.net/viewvc.cgi/phpdoc/en/reference/mysqli/mysqli/commit.xml?view=markup&rev=1.1 Index: phpdoc/en/reference/mysqli/mysqli/commit.xml +++ phpdoc/en/reference/mysqli/mysqli/commit.xml <?xml version="1.0" encoding="iso-8859-1"?> <!-- $Revision: 1.1 $ --> <refentry xml:id="function.mysqli-commit" xmlns="http://docbook.org/ns/docbook"> <refnamediv> <refname>mysqli_commit</refname> <refname>mysqli->commit()</refname> <refpurpose>Commits the current transaction</refpurpose> </refnamediv> <refsect1 role="description"> &reftitle.description; <para>Procedural style:</para> <methodsynopsis> <type>bool</type><methodname>mysqli_commit</methodname> <methodparam><type>mysqli</type><parameter>link</parameter></methodparam> </methodsynopsis> <para>Object oriented style (method)</para> <classsynopsis> <ooclass><classname>mysqli</classname></ooclass> <methodsynopsis> <type>bool</type><methodname>commit</methodname> <void /> </methodsynopsis> </classsynopsis> <para> Commits the current transaction 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> &return.success; </para> </refsect1> <refsect1 role="examples"> &reftitle.examples; <para> <example> <title>Object oriented style</title> <programlisting role="php"> <![CDATA[ <?php $mysqli = new mysqli("localhost", "my_user", "my_password", "world"); /* check connection */ if (mysqli_connect_errno()) { printf("Connect failed: %s\n", mysqli_connect_error()); exit(); } $mysqli->query("CREATE TABLE Language LIKE CountryLanguage Type=InnoDB"); /* 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> </example> <example> <title>Procedural style</title> <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 Type=InnoDB"); /* 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> </para> </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:"../../../../manual.ced" sgml-exposed-tags:nil sgml-local-catalogs:nil sgml-local-ecat-files:nil End: vim600: syn=xml fen fdm=syntax fdl=2 si vim: et tw=78 syn=sgml vi: ts=1 sw=1 --> http://cvs.php.net/viewvc.cgi/phpdoc/en/reference/mysqli/mysqli/connect-errno.xml?view=markup&rev=1.1 Index: phpdoc/en/reference/mysqli/mysqli/connect-errno.xml +++ phpdoc/en/reference/mysqli/mysqli/connect-errno.xml <?xml version="1.0" encoding="iso-8859-1"?> <!-- $Revision: 1.1 $ --> <refentry xml:id="function.mysqli-connect-errno" xmlns="http://docbook.org/ns/docbook"> <refnamediv> <refname>mysqli_connect_errno</refname> <refpurpose>Returns the error code from last connect call</refpurpose> </refnamediv> <refsect1 role="description"> &reftitle.description; <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; <para> <example> <title><function>mysqli_connect_errno</function> example</title> <programlisting role="php"> <![CDATA[ <?php $link = @mysqli_connect("localhost", "nonexisting_user", ""); if (!$link) { printf("Can't connect to localhost. Errorcode: %d\n", mysqli_connect_errno()); } ?> ]]> </programlisting> </example> </para> </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:"../../../../manual.ced" sgml-exposed-tags:nil sgml-local-catalogs:nil sgml-local-ecat-files:nil End: vim600: syn=xml fen fdm=syntax fdl=2 si vim: et tw=78 syn=sgml vi: ts=1 sw=1 --> http://cvs.php.net/viewvc.cgi/phpdoc/en/reference/mysqli/mysqli/connect-error.xml?view=markup&rev=1.1 Index: phpdoc/en/reference/mysqli/mysqli/connect-error.xml +++ phpdoc/en/reference/mysqli/mysqli/connect-error.xml <?xml version="1.0" encoding="iso-8859-1"?> <!-- $Revision: 1.1 $ --> <refentry xml:id="function.mysqli-connect-error" xmlns="http://docbook.org/ns/docbook"> <refnamediv> <refname>mysqli_connect_error</refname> <refpurpose>Returns a string description of the last connect error</refpurpose> </refnamediv> <refsect1 role="description"> &reftitle.description; <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. An empty string if no error occurred. </para> </refsect1> <refsect1 role="examples"> &reftitle.examples; <para> <example> <title><function>mysqli_connect_error</function> example</title> <programlisting role="php"> <![CDATA[ <?php $link = @mysqli_connect("localhost", "nonexisting_user", ""); if (!$link) { printf("Can't connect to localhost. Error: %s\n", mysqli_connect_error()); } ?> ]]> </programlisting> </example> </para> </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:"../../../../manual.ced" sgml-exposed-tags:nil sgml-local-catalogs:nil sgml-local-ecat-files:nil End: vim600: syn=xml fen fdm=syntax fdl=2 si vim: et tw=78 syn=sgml vi: ts=1 sw=1 --> http://cvs.php.net/viewvc.cgi/phpdoc/en/reference/mysqli/mysqli/connect.xml?view=markup&rev=1.1 Index: phpdoc/en/reference/mysqli/mysqli/connect.xml +++ phpdoc/en/reference/mysqli/mysqli/connect.xml <?xml version="1.0" encoding="iso-8859-1"?> <!-- $Revision: 1.1 $ --> <refentry xml:id="function.mysqli-connect" xmlns="http://docbook.org/ns/docbook"> <refnamediv> <refname>mysqli_connect</refname> <refname>mysqli->__construct()</refname> <refpurpose>Open a new connection to the MySQL server</refpurpose> </refnamediv> <refsect1 role="description"> &reftitle.description; <para>Procedural style</para> <methodsynopsis> <type>mysqli</type><methodname>mysqli_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> </methodsynopsis> <para>Object oriented style (constructor):</para> <classsynopsis> <ooclass><classname>mysqli</classname></ooclass> <constructorsynopsis> <methodname>__construct</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> </constructorsynopsis> </classsynopsis> <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> </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 a object which represents the connection to a MySQL Server or &false; if the connection failed. </para> </refsect1> <refsect1 role="examples"> &reftitle.examples; <example> <title>Object oriented style</title> <programlisting role="php"> <![CDATA[ <?php $mysqli = new mysqli("localhost", "my_user", "my_password", "world"); /* check connection */ if (mysqli_connect_errno()) { printf("Connect failed: %s\n", mysqli_connect_error()); exit(); } printf("Host information: %s\n", $mysqli->host_info); /* close connection */ $mysqli->close(); ?> ]]> </programlisting> </example> <example> <title>Procedural style</title> <programlisting role="php"> <![CDATA[ <?php $link = mysqli_connect("localhost", "my_user", "my_password", "world"); /* check connection */ if (!$link) { printf("Connect failed: %s\n", mysqli_connect_error()); exit(); } printf("Host information: %s\n", mysqli_get_host_info($link)); /* close connection */ mysqli_close($link); ?> ]]> </programlisting> </example> &example.outputs; <screen> <![CDATA[ Host information: Localhost via UNIX socket ]]> </screen> </refsect1> <refsect1 role="notes"> &reftitle.notes; <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> </refentry> <!-- Keep this comment at the end of the file Local variables: mode: sgml sgml-omittag:t sgml-shorttag:t sgml-minimize-attributes:nil sgml-always-quote-attributes:t sgml-indent-step:1 sgml-indent-data:t indent-tabs-mode:nil sgml-parent-document:nil sgml-default-dtd-file:"../../../../manual.ced" sgml-exposed-tags:nil sgml-local-catalogs:nil sgml-local-ecat-files:nil End: vim600: syn=xml fen fdm=syntax fdl=2 si vim: et tw=78 syn=sgml vi: ts=1 sw=1 --> http://cvs.php.net/viewvc.cgi/phpdoc/en/reference/mysqli/mysqli/debug.xml?view=markup&rev=1.1 Index: phpdoc/en/reference/mysqli/mysqli/debug.xml +++ phpdoc/en/reference/mysqli/mysqli/debug.xml <?xml version="1.0" encoding="iso-8859-1"?> <!-- $Revision: 1.1 $ --> <refentry xml:id="function.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>Procedural style:</para> <methodsynopsis> <type>bool</type><methodname>mysqli_debug</methodname> <methodparam><type>string</type><parameter>message</parameter></methodparam> </methodsynopsis> <para>Object oriented style (method):</para> <classsynopsis> <ooclass><classname>mysqli</classname></ooclass> <methodsynopsis> <type>bool</type><methodname>debug</methodname> <methodparam><type>string</type><parameter>message</parameter></methodparam> </methodsynopsis> </classsynopsis> <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 complile 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:0,/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:"../../../../manual.ced" sgml-exposed-tags:nil sgml-local-catalogs:nil sgml-local-ecat-files:nil End: vim600: syn=xml fen fdm=syntax fdl=2 si vim: et tw=78 syn=sgml vi: ts=1 sw=1 --> http://cvs.php.net/viewvc.cgi/phpdoc/en/reference/mysqli/mysqli/dump-debug-info.xml?view=markup&rev=1.1 Index: phpdoc/en/reference/mysqli/mysqli/dump-debug-info.xml +++ phpdoc/en/reference/mysqli/mysqli/dump-debug-info.xml <?xml version="1.0" encoding="iso-8859-1"?> <!-- $Revision: 1.1 $ --> <refentry xml:id="function.mysqli-dump-debug-info" xmlns="http://docbook.org/ns/docbook"> <refnamediv> <refname>mysqli_dump_debug_info</refname> <refname>mysqli->dump_debug_info()</refname> <refpurpose>Dump debugging information into the log</refpurpose> </refnamediv> <refsect1 role="description"> &reftitle.description; <para>Procedural style:</para> <methodsynopsis> <type>bool</type><methodname>mysqli_dump_debug_info</methodname> <methodparam><type>mysqli</type><parameter>link</parameter></methodparam> </methodsynopsis> <para>Object oriented style (method):</para> <classsynopsis> <ooclass><classname>mysqli</classname></ooclass> <methodsynopsis> <type>bool</type><methodname>dump_debug_info</methodname> <void/> </methodsynopsis> </classsynopsis> <para> This function is designed to be executed by an user with the SUPER privilege and is used to dump debugging information into the log for the MySQL Server relating to the 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="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:"../../../../manual.ced" sgml-exposed-tags:nil sgml-local-catalogs:nil sgml-local-ecat-files:nil End: vim600: syn=xml fen fdm=syntax fdl=2 si vim: et tw=78 syn=sgml vi: ts=1 sw=1 --> http://cvs.php.net/viewvc.cgi/phpdoc/en/reference/mysqli/mysqli/errno.xml?view=markup&rev=1.1 Index: phpdoc/en/reference/mysqli/mysqli/errno.xml +++ phpdoc/en/reference/mysqli/mysqli/errno.xml <?xml version="1.0" encoding="iso-8859-1"?> <!-- $Revision: 1.1 $ --> <refentry xml:id="function.mysqli-errno" xmlns="http://docbook.org/ns/docbook"> <refnamediv> <refname>mysqli_errno</refname> <refname>mysqli->errno</refname> <refpurpose>Returns the error code for the most recent function call</refpurpose> </refnamediv> <refsect1 role="description"> &reftitle.description; <para>Procedural style:</para> <methodsynopsis> <type>int</type><methodname>mysqli_errno</methodname> <methodparam><type>mysqli</type><parameter>link</parameter></methodparam> </methodsynopsis> <para>Object oriented style (property):</para> <classsynopsis> <ooclass><classname>mysqli</classname></ooclass> <fieldsynopsis><type>int</type><varname>errno</varname></fieldsynopsis> </classsynopsis> <para> Returns the last error code for the most recent MySQLi function call that can succeed or fail. </para> <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> </refsect1> <refsect1 role="parameters"> &reftitle.parameters; <para> <variablelist> &mysqli.link.description; </variablelist> </para> </refsect1> <refsect1 role="returnvalues"> &reftitle.returnvalues; <para> An error code value for the last call, if it failed. zero means no error occurred. </para> </refsect1> <refsect1 role="examples"> &reftitle.examples; <example> <title>Object oriented style</title> <programlisting role="php"> <![CDATA[ <?php $mysqli = new mysqli("localhost", "my_user", "my_password", "world"); /* check connection */ if (mysqli_connect_errno()) { printf("Connect failed: %s\n", mysqli_connect_error()); exit(); } if (!$mysqli->query("SET a=1")) { printf("Errorcode: %d\n", $mysqli->errno); } /* close connection */ $mysqli->close(); ?> ]]> </programlisting> </example> <example> <title>Procedural style</title> <programlisting role="php"> <![CDATA[ <?php $link = mysqli_connect("localhost", "my_user", "my_password", "world"); /* check connection */ if (mysqli_connect_errno()) { printf("Connect failed: %s\n", mysqli_connect_error()); exit(); } if (!mysqli_query($link, "SET a=1")) { printf("Errorcode: %d\n", mysqli_errno($link)); } /* close connection */ mysqli_close($link); ?> ]]> </programlisting> </example> &example.outputs; <screen> <![CDATA[ Errorcode: 1193 ]]> </screen> </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:"../../../../manual.ced" sgml-exposed-tags:nil sgml-local-catalogs:nil sgml-local-ecat-files:nil End: vim600: syn=xml fen fdm=syntax fdl=2 si vim: et tw=78 syn=sgml vi: ts=1 sw=1 --> http://cvs.php.net/viewvc.cgi/phpdoc/en/reference/mysqli/mysqli/error.xml?view=markup&rev=1.1 Index: phpdoc/en/reference/mysqli/mysqli/error.xml +++ phpdoc/en/reference/mysqli/mysqli/error.xml <?xml version="1.0" encoding="iso-8859-1"?> <!-- $Revision: 1.1 $ --> <refentry xml:id="function.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>Procedural style:</para> <methodsynopsis> <type>string</type><methodname>mysqli_error</methodname> <methodparam><type>mysqli</type><parameter>link</parameter></methodparam> </methodsynopsis> <para>Object oriented style (property):</para> <classsynopsis> <ooclass><classname>mysqli</classname></ooclass> <fieldsynopsis><type>string</type><varname>error</varname></fieldsynopsis> </classsynopsis> <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>Object oriented style</title> <programlisting role="php"> <![CDATA[ <?php $mysqli = new mysqli("localhost", "my_user", "my_password", "world"); /* check connection */ if (mysqli_connect_errno()) { printf("Connect failed: %s\n", mysqli_connect_error()); exit(); } if (!$mysqli->query("SET a=1")) { printf("Errormessage: %s\n", $mysqli->error); } /* close connection */ $mysqli->close(); ?> ]]> </programlisting> </example> <example> <title>Procedural style</title> <programlisting role="php"> <![CDATA[ <?php $link = mysqli_connect("localhost", "my_user", "my_password", "world"); /* check connection */ if (mysqli_connect_errno()) { printf("Connect failed: %s\n", mysqli_connect_error()); exit(); } if (!mysqli_query($link, "SET a=1")) { printf("Errormessage: %s\n", mysqli_error($link)); } /* close connection */ mysqli_close($link); ?> ]]> </programlisting> </example> &example.outputs; <screen> <![CDATA[ Errormessage: Unknown system variable 'a' ]]> </screen> </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:"../../../../manual.ced" sgml-exposed-tags:nil sgml-local-catalogs:nil sgml-local-ecat-files:nil End: vim600: syn=xml fen fdm=syntax fdl=2 si vim: et tw=78 syn=sgml vi: ts=1 sw=1 --> http://cvs.php.net/viewvc.cgi/phpdoc/en/reference/mysqli/mysqli/field-count.xml?view=markup&rev=1.1 Index: phpdoc/en/reference/mysqli/mysqli/field-count.xml +++ phpdoc/en/reference/mysqli/mysqli/field-count.xml <?xml version="1.0" encoding="iso-8859-1"?> <!-- $Revision: 1.1 $ --> <refentry xml:id="function.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>Procedural style:</para> <methodsynopsis> <type>int</type><methodname>mysqli_field_count</methodname> <methodparam><type>mysqli</type><parameter>link</parameter></methodparam> </methodsynopsis> <para>Object oriented style (property):</para> <classsynopsis> <ooclass><classname>mysqli_result</classname></ooclass> <fieldsynopsis><type>int</type><varname>field_count</varname></fieldsynopsis> </classsynopsis> <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; <para> <example> <title>Object oriented style</title> <programlisting role='php'> <![CDATA[ <?php $mysqli = new mysqli("localhost", "my_user", "my_password", "test"); $mysqli->query( "DROP TABLE IF EXISTS friends"); $mysqli->query( "CREATE TABLE friends (id int, name varchar(20))"); $mysqli->query( "INSERT INTO friends VALUES (1,'Hartmut'), (2, 'Ulf')"); $mysqli->real_query($HTTP_POST_VARS['query']); 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> </example> <example> <title>Procedural style</title> <programlisting role='php'> <![CDATA[ <?php $link = mysqli_connect("localhost", "my_user", "my_password", "test"); mysqli_query($link, "DROP TABLE IF EXISTS friends"); mysqli_query($link, "CREATE TABLE friends (id int, name varchar(20))"); mysqli_query($link, "INSERT INTO friends VALUES (1,'Hartmut'), (2, 'Ulf')"); mysqli_real_query($link, $HTTP_POST_VARS['query']); 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> </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:"../../../../manual.ced" sgml-exposed-tags:nil sgml-local-catalogs:nil sgml-local-ecat-files:nil End: vim600: syn=xml fen fdm=syntax fdl=2 si vim: et tw=78 syn=sgml vi: ts=1 sw=1 --> http://cvs.php.net/viewvc.cgi/phpdoc/en/reference/mysqli/mysqli/get-charset.xml?view=markup&rev=1.1 Index: phpdoc/en/reference/mysqli/mysqli/get-charset.xml +++ phpdoc/en/reference/mysqli/mysqli/get-charset.xml <?xml version="1.0" encoding="iso-8859-1"?> <!-- $Revision: 1.1 $ --> <refentry xml:id="function.mysqli-get-charset" xmlns="http://docbook.org/ns/docbook"> <refnamediv> <refname>mysqli_get_charset</refname> <refpurpose>Returns a character set object</refpurpose> </refnamediv> <refsect1 role="description"> &reftitle.description; <methodsynopsis> <type>object</type><methodname>mysqli_get_charset</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:"../../../../manual.ced" sgml-exposed-tags:nil sgml-local-catalogs:nil sgml-local-ecat-files:nil End: vim600: syn=xml fen fdm=syntax fdl=2 si vim: et tw=78 syn=sgml vi: ts=1 sw=1 --> http://cvs.php.net/viewvc.cgi/phpdoc/en/reference/mysqli/mysqli/get-client-info.xml?view=markup&rev=1.1 Index: phpdoc/en/reference/mysqli/mysqli/get-client-info.xml +++ phpdoc/en/reference/mysqli/mysqli/get-client-info.xml <?xml version="1.0" encoding="iso-8859-1"?> <!-- $Revision: 1.1 $ --> <refentry xml:id="function.mysqli-get-client-info" xmlns="http://docbook.org/ns/docbook"> <refnamediv> <refname>mysqli_get_client_info</refname> <refpurpose>Returns the MySQL client version as a string</refpurpose> </refnamediv> <refsect1 role="description"> &reftitle.description; <methodsynopsis> <type>string</type><methodname>mysqli_get_client_info</methodname> <void /> </methodsynopsis> <para> The <function>mysqli_get_client_info</function> function is used to return a string representing the client version being used in the MySQLi extension. </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:"../../../../manual.ced" sgml-exposed-tags:nil sgml-local-catalogs:nil sgml-local-ecat-files:nil End: vim600: syn=xml fen fdm=syntax fdl=2 si vim: et tw=78 syn=sgml vi: ts=1 sw=1 --> http://cvs.php.net/viewvc.cgi/phpdoc/en/reference/mysqli/mysqli/get-client-version.xml?view=markup&rev=1.1 Index: phpdoc/en/reference/mysqli/mysqli/get-client-version.xml +++ phpdoc/en/reference/mysqli/mysqli/get-client-version.xml <?xml version="1.0" encoding="iso-8859-1"?> <!-- $Revision: 1.1 $ --> <refentry xml:id="function.mysqli-get-client-version" xmlns="http://docbook.org/ns/docbook"> <refnamediv> <refname>mysqli_get_client_version</refname> <refpurpose>Get MySQL client info</refpurpose> </refnamediv> <refsect1 role="description"> &reftitle.description; <methodsynopsis> <type>int</type><methodname>mysqli_get_client_version</methodname> <void/> </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:"../../../../manual.ced" sgml-exposed-tags:nil sgml-local-catalogs:nil sgml-local-ecat-files:nil End: vim600: syn=xml fen fdm=syntax fdl=2 si vim: et tw=78 syn=sgml vi: ts=1 sw=1 --> http://cvs.php.net/viewvc.cgi/phpdoc/en/reference/mysqli/mysqli/get-host-info.xml?view=markup&rev=1.1 Index: phpdoc/en/reference/mysqli/mysqli/get-host-info.xml +++ phpdoc/en/reference/mysqli/mysqli/get-host-info.xml <?xml version="1.0" encoding="iso-8859-1"?> <!-- $Revision: 1.1 $ --> <refentry xml:id="function.mysqli-get-host-info" xmlns="http://docbook.org/ns/docbook"> <refnamediv> <refname>mysqli_get_host_info</refname> <refname>mysqli->host_info</refname> <refpurpose>Returns a string representing the type of connection used</refpurpose> </refnamediv> <refsect1 role="description"> &reftitle.description; <para>Procdural style:</para> <methodsynopsis> <type>string</type><methodname>mysqli_get_host_info</methodname> <methodparam><type>mysqli</type><parameter>link</parameter></methodparam> </methodsynopsis> <para>Object oriented style (property):</para> <classsynopsis> <ooclass><classname>mysqli</classname></ooclass> <fieldsynopsis><type>string</type><varname>host_info</varname></fieldsynopsis> </classsynopsis> <para> The <function>mysqli_get_host_info</function> function returns a string describing the connection represented by the <parameter>link</parameter> parameter is using (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>Object oriented style</title> <programlisting role="php"> <![CDATA[ <?php $mysqli = new mysqli("localhost", "my_user", "my_password", "world"); /* check connection */ if (mysqli_connect_errno()) { printf("Connect failed: %s\n", mysqli_connect_error()); exit(); } /* print host information */ printf("Host info: %s\n", $mysqli->host_info); /* close connection */ $mysqli->close(); ?> ]]> </programlisting> </example> <example> <title>Procedural style</title> <programlisting role="php"> <![CDATA[ <?php $link = mysqli_connect("localhost", "my_user", "my_password", "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> </example> &example.outputs; <screen> <![CDATA[ Host info: Localhost via UNIX socket ]]> </screen> </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:"../../../../manual.ced" sgml-exposed-tags:nil sgml-local-catalogs:nil sgml-local-ecat-files:nil End: vim600: syn=xml fen fdm=syntax fdl=2 si vim: et tw=78 syn=sgml vi: ts=1 sw=1 --> http://cvs.php.net/viewvc.cgi/phpdoc/en/reference/mysqli/mysqli/get-proto-info.xml?view=markup&rev=1.1 Index: phpdoc/en/reference/mysqli/mysqli/get-proto-info.xml +++ phpdoc/en/reference/mysqli/mysqli/get-proto-info.xml <?xml version="1.0" encoding="iso-8859-1"?> <!-- $Revision: 1.1 $ --> <refentry xml:id="function.mysqli-get-proto-info" xmlns="http://docbook.org/ns/docbook"> <refnamediv> <refname>mysqli_get_proto_info</refname> <refname>mysqli->protocol_version</refname> <refpurpose>Returns the version of the MySQL protocol used</refpurpose> </refnamediv> <refsect1 role="description"> &reftitle.description; <para>Procedural style:</para> <methodsynopsis> <type>int</type><methodname>mysqli_get_proto_info</methodname> <methodparam><type>mysqli</type><parameter>link</parameter></methodparam> </methodsynopsis> <para>Object oriented style (property):</para> <classsynopsis> <ooclass><classname>mysqli</classname></ooclass> <fieldsynopsis><type>string</type><varname>protocol_version</varname></fieldsynopsis> </classsynopsis> <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>Object oriented style</title> <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> </example> <example> <title>Procedural style</title> <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> </example> &example.outputs; <screen> <![CDATA[ Protocol version: 10 ]]> </screen> </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:"../../../../manual.ced" sgml-exposed-tags:nil sgml-local-catalogs:nil sgml-local-ecat-files:nil End: vim600: syn=xml fen fdm=syntax fdl=2 si vim: et tw=78 syn=sgml vi: ts=1 sw=1 --> http://cvs.php.net/viewvc.cgi/phpdoc/en/reference/mysqli/mysqli/get-server-info.xml?view=markup&rev=1.1 Index: phpdoc/en/reference/mysqli/mysqli/get-server-info.xml +++ phpdoc/en/reference/mysqli/mysqli/get-server-info.xml <?xml version="1.0" encoding="iso-8859-1"?> <!-- $Revision: 1.1 $ --> <refentry xml:id="function.mysqli-get-server-info" xmlns="http://docbook.org/ns/docbook"> <refnamediv> <refname>mysqli_get_server_info</refname> <refname>mysqli->server_info</refname> <refpurpose>Returns the version of the MySQL server</refpurpose> </refnamediv> <refsect1 role="description"> &reftitle.description; <para>Procedural style:</para> <methodsynopsis> <type>string</type><methodname>mysqli_get_server_info</methodname> <methodparam><type>mysqli</type><parameter>link</parameter></methodparam> </methodsynopsis> <para>Object oriented style (property):</para> <classsynopsis> <ooclass><classname>mysqli</classname></ooclass> <fieldsynopsis><type>string</type><varname>server_info</varname></fieldsynopsis> </classsynopsis> <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>Object oriented style</title> <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> </example> <example> <title>Procedural style</title> <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> </example> &example.outputs; <screen> <![CDATA[ Server version: 4.1.2-alpha-debug ]]> </screen> </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:"../../../../manual.ced" sgml-exposed-tags:nil sgml-local-catalogs:nil sgml-local-ecat-files:nil End: vim600: syn=xml fen fdm=syntax fdl=2 si vim: et tw=78 syn=sgml vi: ts=1 sw=1 --> http://cvs.php.net/viewvc.cgi/phpdoc/en/reference/mysqli/mysqli/get-server-version.xml?view=markup&rev=1.1 Index: phpdoc/en/reference/mysqli/mysqli/get-server-version.xml +++ phpdoc/en/reference/mysqli/mysqli/get-server-version.xml <?xml version="1.0" encoding="iso-8859-1"?> <!-- $Revision: 1.1 $ --> <refentry xml:id="function.mysqli-get-server-version" xmlns="http://docbook.org/ns/docbook"> <refnamediv> <refname>mysqli_get_server_version</refname> <refname>mysqli->server_version</refname> <refpurpose>Returns the version of the MySQL server as an integer</refpurpose> </refnamediv> <refsect1 role="description"> &reftitle.description; <para>Procedural style:</para> <methodsynopsis> <type>int</type><methodname>mysqli_get_server_version</methodname> <methodparam><type>mysqli</type><parameter>link</parameter></methodparam> </methodsynopsis> <para>Object oriented style (property):</para> <classsynopsis> <ooclass><classname>mysqli</classname></ooclass> <fieldsynopsis><type>int</type><varname>server_version</varname></fieldsynopsis> </classsynopsis> <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>Object oriented style</title> <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> </example> <example> <title>Procedural style</title> <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> </example> &example.outputs; <screen> <![CDATA[ Server version: 40102 ]]> </screen> </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:"../../../../manual.ced" sgml-exposed-tags:nil sgml-local-catalogs:nil sgml-local-ecat-files:nil End: vim600: syn=xml fen fdm=syntax fdl=2 si vim: et tw=78 syn=sgml vi: ts=1 sw=1 --> http://cvs.php.net/viewvc.cgi/phpdoc/en/reference/mysqli/mysqli/get-warnings.xml?view=markup&rev=1.1 Index: phpdoc/en/reference/mysqli/mysqli/get-warnings.xml +++ phpdoc/en/reference/mysqli/mysqli/get-warnings.xml <?xml version="1.0" encoding="iso-8859-1"?> <!-- $Revision: 1.1 $ --> <refentry xml:id="function.mysqli-get-warnings" xmlns="http://docbook.org/ns/docbook"> <refnamediv> <refname>mysqli_get_warnings</refname> <refpurpose></refpurpose> </refnamediv> <refsect1 role="description"> &reftitle.description; <methodsynopsis> <type>object</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:"../../../../manual.ced" sgml-exposed-tags:nil sgml-local-catalogs:nil sgml-local-ecat-files:nil End: vim600: syn=xml fen fdm=syntax fdl=2 si vim: et tw=78 syn=sgml vi: ts=1 sw=1 --> http://cvs.php.net/viewvc.cgi/phpdoc/en/reference/mysqli/mysqli/info.xml?view=markup&rev=1.1 Index: phpdoc/en/reference/mysqli/mysqli/info.xml +++ phpdoc/en/reference/mysqli/mysqli/info.xml <?xml version="1.0" encoding="iso-8859-1"?> <!-- $Revision: 1.1 $ --> <refentry xml:id="function.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>Procedural style:</para> <methodsynopsis> <type>string</type><methodname>mysqli_info</methodname> <methodparam><type>mysqli</type><parameter>link</parameter></methodparam> </methodsynopsis> <para>Object oriented style (property)</para> <classsynopsis> <ooclass><classname>mysqli</classname></ooclass> <fieldsynopsis><type>string</type><varname>info</varname></fieldsynopsis> </classsynopsis> <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 above 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>Object oriented style</title> <programlisting role="php"> <![CDATA[ <?php $mysqli = new mysqli("localhost", "my_user", "my_password", "world"); /* check connection */ if (mysqli_connect_errno()) { printf("Connect failed: %s\n", mysqli_connect_error()); exit(); } $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> </example> <example> <title>Procedural style</title> <programlisting role="php"> <![CDATA[ <?php $link = mysqli_connect("localhost", "my_user", "my_password", "world"); /* check connection */ if (mysqli_connect_errno()) { printf("Connect failed: %s\n", mysqli_connect_error()); exit(); } 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> </example> &example.outputs; <screen> <![CDATA[ Records: 150 Duplicates: 0 Warnings: 0 ]]> </screen> </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:"../../../../manual.ced" sgml-exposed-tags:nil sgml-local-catalogs:nil sgml-local-ecat-files:nil End: vim600: syn=xml fen fdm=syntax fdl=2 si vim: et tw=78 syn=sgml vi: ts=1 sw=1 --> http://cvs.php.net/viewvc.cgi/phpdoc/en/reference/mysqli/mysqli/init.xml?view=markup&rev=1.1 Index: phpdoc/en/reference/mysqli/mysqli/init.xml +++ phpdoc/en/reference/mysqli/mysqli/init.xml <?xml version="1.0" encoding="iso-8859-1"?> <!-- $Revision: 1.1 $ --> <refentry xml:id="function.mysqli-init" xmlns="http://docbook.org/ns/docbook"> <refnamediv> <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>Procedural style:</para> <methodsynopsis> <type>mysqli</type><methodname>mysqli_init</methodname> <void/> </methodsynopsis> <para>Object oriented style (method):</para> <classsynopsis> <ooclass><classname>mysqli</classname></ooclass> <methodsynopsis> <type>mysqli</type><methodname>init</methodname> <void/> </methodsynopsis> </classsynopsis> <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="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:"../../../../manual.ced" sgml-exposed-tags:nil sgml-local-catalogs:nil sgml-local-ecat-files:nil End: vim600: syn=xml fen fdm=syntax fdl=2 si vim: et tw=78 syn=sgml vi: ts=1 sw=1 --> http://cvs.php.net/viewvc.cgi/phpdoc/en/reference/mysqli/mysqli/insert-id.xml?view=markup&rev=1.1 Index: phpdoc/en/reference/mysqli/mysqli/insert-id.xml +++ phpdoc/en/reference/mysqli/mysqli/insert-id.xml <?xml version="1.0" encoding="iso-8859-1"?> <!-- $Revision: 1.1 $ --> <refentry xml:id="function.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>Procedural style:</para> <methodsynopsis> <type>int</type><methodname>mysqli_insert_id</methodname> <methodparam><type>mysqli</type><parameter>link</parameter></methodparam> </methodsynopsis> <para>Object oriented style (property):</para> <classsynopsis> <ooclass><classname>mysqli</classname></ooclass> <fieldsynopsis><type>int</type><varname>insert_id</varname></fieldsynopsis> </classsynopsis> <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>Object oriented style</title> <programlisting role="php"> <![CDATA[ <?php $mysqli = new mysqli("localhost", "my_user", "my_password", "world"); /* check connection */ if (mysqli_connect_errno()) { printf("Connect failed: %s\n", mysqli_connect_error()); exit(); } $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> </example> <example> <title>Procedural style</title> <programlisting role="php"> <![CDATA[ <?php $link = mysqli_connect("localhost", "my_user", "my_password", "world"); /* check connection */ if (mysqli_connect_errno()) { printf("Connect failed: %s\n", mysqli_connect_error()); exit(); } 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> </example> &example.outputs; <screen> <![CDATA[ New Record has id 1. ]]> </screen> </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:"../../../../manual.ced" sgml-exposed-tags:nil sgml-local-catalogs:nil sgml-local-ecat-files:nil End: vim600: syn=xml fen fdm=syntax fdl=2 si vim: et tw=78 syn=sgml vi: ts=1 sw=1 --> http://cvs.php.net/viewvc.cgi/phpdoc/en/reference/mysqli/mysqli/kill.xml?view=markup&rev=1.1 Index: phpdoc/en/reference/mysqli/mysqli/kill.xml +++ phpdoc/en/reference/mysqli/mysqli/kill.xml <?xml version="1.0" encoding="iso-8859-1"?> <!-- $Revision: 1.1 $ --> <refentry xml:id="function.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>Procedural style:</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>Object oriented style (method)</para> <classsynopsis> <ooclass><classname>mysqli</classname></ooclass> <methodsynopsis> <type>bool</type><methodname>kill</methodname> <methodparam><type>int</type><parameter>processid</parameter></methodparam> </methodsynopsis> </classsynopsis> <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>Object oriented style</title> <programlisting role="php"> <![CDATA[ <?php $mysqli = new mysqli("localhost", "my_user", "my_password", "world"); /* check connection */ if (mysqli_connect_errno()) { printf("Connect failed: %s\n", mysqli_connect_error()); exit(); } /* determine our thread id */ $thread_id = $mysqli->thread_id; /* Kill connection */ $mysqli->kill($thread_id); /* This should produce an error */ if (!$mysqli->query("CREATE TABLE myCity LIKE City")) { printf("Error: %s\n", $mysqli->error); exit; } /* close connection */ $mysqli->close(); ?> ]]> </programlisting> </example> <example> <title>Procedural style</title> <programlisting role="php"> <![CDATA[ <?php $link = mysqli_connect("localhost", "my_user", "my_password", "world"); /* check connection */ if (mysqli_connect_errno()) { printf("Connect failed: %s\n", mysqli_connect_error()); exit(); } /* determine our thread id */ $thread_id = mysqli_thread_id($link); /* Kill connection */ mysqli_kill($link, $thread_id); /* This should produce an error */ if (!mysqli_query($link, "CREATE TABLE myCity LIKE City")) { printf("Error: %s\n", mysqli_error($link)); exit; } /* close connection */ mysqli_close($link); ?> ]]> </programlisting> </example> &example.outputs; <screen> <![CDATA[ Error: MySQL server has gone away ]]> </screen> </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:"../../../../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:"../../../../manual.ced" sgml-exposed-tags:nil sgml-local-catalogs:nil sgml-local-ecat-files:nil End: vim600: syn=xml fen fdm=syntax fdl=2 si vim: et tw=78 syn=sgml vi: ts=1 sw=1 --> http://cvs.php.net/viewvc.cgi/phpdoc/en/reference/mysqli/mysqli/more-results.xml?view=markup&rev=1.1 Index: phpdoc/en/reference/mysqli/mysqli/more-results.xml +++ phpdoc/en/reference/mysqli/mysqli/more-results.xml <?xml version="1.0" encoding="iso-8859-1"?> <!-- $Revision: 1.1 $ --> <refentry xml:id="function.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; <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:"../../../../manual.ced" sgml-exposed-tags:nil sgml-local-catalogs:nil sgml-local-ecat-files:nil End: vim600: syn=xml fen fdm=syntax fdl=2 si vim: et tw=78 syn=sgml vi: ts=1 sw=1 --> http://cvs.php.net/viewvc.cgi/phpdoc/en/reference/mysqli/mysqli/multi-query.xml?view=markup&rev=1.1 Index: phpdoc/en/reference/mysqli/mysqli/multi-query.xml +++ phpdoc/en/reference/mysqli/mysqli/multi-query.xml <?xml version="1.0" encoding="iso-8859-1"?> <!-- $Revision: 1.1 $ --> <refentry xml:id="function.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>Procedural style:</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>Object oriented style (method):</para> <classsynopsis> <ooclass><classname>mysqli</classname></ooclass> <methodsynopsis> <type>bool</type><methodname>multi_query</methodname> <methodparam><type>string</type><parameter>query</parameter></methodparam> </methodsynopsis> </classsynopsis> <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> </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>Object oriented style</title> <programlisting role="php"> <![CDATA[ <?php $mysqli = new mysqli("localhost", "my_user", "my_password", "world"); /* check connection */ if (mysqli_connect_errno()) { printf("Connect failed: %s\n", mysqli_connect_error()); exit(); } $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->close(); } /* print divider */ if ($mysqli->more_results()) { printf("-----------------\n"); } } while ($mysqli->next_result()); } /* close connection */ $mysqli->close(); ?> ]]> </programlisting> </example> <example> <title>Procedural style</title> <programlisting role="php"> <![CDATA[ <?php $link = mysqli_connect("localhost", "my_user", "my_password", "world"); /* check connection */ if (mysqli_connect_errno()) { printf("Connect failed: %s\n", mysqli_connect_error()); exit(); } $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> </example> &example.outputs.similar; <screen> <![CDATA[ my_user@localhost ----------------- Amersfoort Maastricht Dordrecht Leiden Haarlemmermeer ]]> </screen> </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:"../../../../manual.ced" sgml-exposed-tags:nil sgml-local-catalogs:nil sgml-local-ecat-files:nil End: vim600: syn=xml fen fdm=syntax fdl=2 si vim: et tw=78 syn=sgml vi: ts=1 sw=1 --> http://cvs.php.net/viewvc.cgi/phpdoc/en/reference/mysqli/mysqli/next-result.xml?view=markup&rev=1.1 Index: phpdoc/en/reference/mysqli/mysqli/next-result.xml +++ phpdoc/en/reference/mysqli/mysqli/next-result.xml <?xml version="1.0" encoding="iso-8859-1"?> <!-- $Revision: 1.1 $ --> <refentry xml:id="function.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; <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:"../../../../manual.ced" sgml-exposed-tags:nil sgml-local-catalogs:nil sgml-local-ecat-files:nil End: vim600: syn=xml fen fdm=syntax fdl=2 si vim: et tw=78 syn=sgml vi: ts=1 sw=1 --> http://cvs.php.net/viewvc.cgi/phpdoc/en/reference/mysqli/mysqli/options.xml?view=markup&rev=1.1 Index: phpdoc/en/reference/mysqli/mysqli/options.xml +++ phpdoc/en/reference/mysqli/mysqli/options.xml <?xml version="1.0" encoding="iso-8859-1"?> <!-- $Revision: 1.1 $ --> <refentry xml:id="function.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>Procedural style:</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>Object oriented style (method)</para> <classsynopsis> <ooclass><classname>mysqli</classname></ooclass> <methodsynopsis> <type>bool</type><methodname>options</methodname> <methodparam><type>int</type><parameter>option</parameter></methodparam> <methodparam><type>mixed</type><parameter>value</parameter></methodparam> </methodsynopsis> </classsynopsis> <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</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="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:"../../../../manual.ced" sgml-exposed-tags:nil sgml-local-catalogs:nil sgml-local-ecat-files:nil End: vim600: syn=xml fen fdm=syntax fdl=2 si vim: et tw=78 syn=sgml vi: ts=1 sw=1 --> http://cvs.php.net/viewvc.cgi/phpdoc/en/reference/mysqli/mysqli/ping.xml?view=markup&rev=1.1 Index: phpdoc/en/reference/mysqli/mysqli/ping.xml +++ phpdoc/en/reference/mysqli/mysqli/ping.xml <?xml version="1.0" encoding="iso-8859-1"?> <!-- $Revision: 1.1 $ --> <refentry xml:id="function.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>Procedural style:</para> <methodsynopsis> <type>bool</type><methodname>mysqli_ping</methodname> <methodparam><type>mysqli</type><parameter>link</parameter></methodparam> </methodsynopsis> <para>Object oriented style (method):</para> <classsynopsis> <ooclass><classname>mysqli</classname></ooclass> <methodsynopsis> <type>bool</type><methodname>ping</methodname> <void/> </methodsynopsis> </classsynopsis> <para> Checks whether the connection to the server is working. If it has gone down, and global option <literal>mysqli.reconnect</literal> 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>Object oriented style</title> <programlisting role="php"> <![CDATA[ <?php $mysqli = new mysqli("localhost", "my_user", "my_password", "world"); /* check connection */ if (mysqli_connect_errno()) { printf("Connect failed: %s\n", mysqli_connect_error()); exit(); } /* 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> </example> <example> <title>Procedural style</title> <programlisting role="php"> <![CDATA[ <?php $link = mysqli_connect("localhost", "my_user", "my_password", "world"); /* check connection */ if (mysqli_connect_errno()) { printf("Connect failed: %s\n", mysqli_connect_error()); exit(); } /* 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> </example> &example.outputs; <screen> <![CDATA[ Our connection is ok! ]]> </screen> </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:"../../../../manual.ced" sgml-exposed-tags:nil sgml-local-catalogs:nil sgml-local-ecat-files:nil End: vim600: syn=xml fen fdm=syntax fdl=2 si vim: et tw=78 syn=sgml vi: ts=1 sw=1 --> http://cvs.php.net/viewvc.cgi/phpdoc/en/reference/mysqli/mysqli/prepare.xml?view=markup&rev=1.1 Index: phpdoc/en/reference/mysqli/mysqli/prepare.xml +++ phpdoc/en/reference/mysqli/mysqli/prepare.xml <?xml version="1.0" encoding="iso-8859-1"?> <!-- $Revision: 1.1 $ --> <refentry xml:id="function.mysqli-prepare" xmlns="http://docbook.org/ns/docbook"> <refnamediv> <refname>mysqli_prepare</refname> <refname>mysqli->prepare()</refname> <refpurpose>Prepare a SQL statement for execution</refpurpose> </refnamediv> <refsect1 role="description"> &reftitle.description; <para>Procedure style:</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>Object oriented style (method)</para> <classsynopsis> <ooclass><classname>mysqli</classname></ooclass> <methodsynopsis> <type>mysqli_stmt</type><methodname>prepare</methodname> <methodparam><type>string</type><parameter>query</parameter></methodparam> </methodsynopsis> </classsynopsis> <para> Prepares the SQL query pointed to by the null-terminated string 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 Languange (DML) statements, and not in Data Defination 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 occured. </para> </refsect1> <refsect1 role="examples"> &reftitle.examples; <example> <title>Object oriented style</title> <programlisting role="php"> <![CDATA[ <?php $mysqli = new mysqli("localhost", "my_user", "my_password", "world"); /* check connection */ if (mysqli_connect_errno()) { printf("Connect failed: %s\n", mysqli_connect_error()); exit(); } $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> </example> <example> <title>Procedural style</title> <programlisting role="php"> <![CDATA[ <?php $link = mysqli_connect("localhost", "my_user", "my_password", "world"); /* check connection */ if (mysqli_connect_errno()) { printf("Connect failed: %s\n", mysqli_connect_error()); exit(); } $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> </example> &example.outputs; <screen> <![CDATA[ Amersfoort is in district Utrecht ]]> </screen> </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:"../../../../manual.ced" sgml-exposed-tags:nil sgml-local-catalogs:nil sgml-local-ecat-files:nil End: vim600: syn=xml fen fdm=syntax fdl=2 si vim: et tw=78 syn=sgml vi: ts=1 sw=1 --> http://cvs.php.net/viewvc.cgi/phpdoc/en/reference/mysqli/mysqli/query.xml?view=markup&rev=1.1 Index: phpdoc/en/reference/mysqli/mysqli/query.xml +++ phpdoc/en/reference/mysqli/mysqli/query.xml <?xml version="1.0" encoding="iso-8859-1"?> <!-- $Revision: 1.1 $ --> <refentry xml:id="function.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>Procedural style:</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>Object oriented style (method):</para> <classsynopsis> <ooclass><classname>mysqli</classname></ooclass> <methodsynopsis> <type>mixed</type><methodname>query</methodname> <methodparam><type>string</type><parameter>query</parameter></methodparam> <methodparam choice='opt'><type>int</type><parameter>resultmode</parameter></methodparam> </methodsynopsis> </classsynopsis> <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> </refsect1> <refsect1 role="parameters"> &reftitle.parameters; <para> <variablelist> &mysqli.link.description; <varlistentry> <term><parameter>query</parameter></term> <listitem> <para> The query string. </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> </listitem> </varlistentry> </variablelist> </para> </refsect1> <refsect1 role="returnvalues"> &reftitle.returnvalues; <para> &return.success; For <literal>SELECT, SHOW, DESCRIBE</literal> or <literal>EXPLAIN</literal> <function>mysqli_query</function> will return a result object. </para> </refsect1> <refsect1 role="examples"> &reftitle.examples; <example> <title>Object oriented style</title> <programlisting role="php"> <![CDATA[ <?php $mysqli = new mysqli("localhost", "my_user", "my_password", "world"); /* check connection */ if (mysqli_connect_errno()) { printf("Connect failed: %s\n", mysqli_connect_error()); exit(); } /* 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> </example> <example> <title>Procedural style</title> <programlisting role="php"> <![CDATA[ <?php $link = mysqli_connect("localhost", "my_user", "my_password", "world"); /* check connection */ if (mysqli_connect_errno()) { printf("Connect failed: %s\n", mysqli_connect_error()); exit(); } /* 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> </example> &example.outputs; <screen> <![CDATA[ Table myCity successfully created. Select returned 10 rows. Error: Commands out of sync; You can't run this command now ]]> </screen> </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:"../../../../manual.ced" sgml-exposed-tags:nil sgml-local-catalogs:nil sgml-local-ecat-files:nil End: vim600: syn=xml fen fdm=syntax fdl=2 si vim: et tw=78 syn=sgml vi: ts=1 sw=1 --> http://cvs.php.net/viewvc.cgi/phpdoc/en/reference/mysqli/mysqli/real-connect.xml?view=markup&rev=1.1 Index: phpdoc/en/reference/mysqli/mysqli/real-connect.xml +++ phpdoc/en/reference/mysqli/mysqli/real-connect.xml <?xml version="1.0" encoding="iso-8859-1"?> <!-- $Revision: 1.1 $ --> <refentry xml:id="function.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>Procedural style</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>Object oriented style (method)</para> <classsynopsis> <ooclass><classname>mysqli</classname></ooclass> <methodsynopsis> <type>bool</type><methodname>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> </classsynopsis> <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 function <function>mysqli_options</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>Object oriented style</title> <programlisting role="php"> <![CDATA[ <?php /* create a connection object which is not connected */ $mysqli = mysqli_init(); /* set connection options */ $mysqli->options(MYSQLI_INIT_COMMAND, "SET AUTOCOMMIT=0"); $mysqli->options(MYSQLI_OPT_CONNECT_TIMEOUT, 5); /* connect to server */ $mysqli->real_connect('localhost', 'my_user', 'my_password', 'world'); /* check connection */ if (mysqli_connect_errno()) { printf("Connect failed: %s\n", mysqli_connect_error()); exit(); } printf ("Connection: %s\n.", $mysqli->host_info); $mysqli->close(); ?> ]]> </programlisting> </example> <example> <title>Procedural style</title> <programlisting role="php"> <![CDATA[ <?php /* create a connection object which is not connected */ $link = mysqli_init(); /* set connection options */ mysqli_options($link, MYSQLI_INIT_COMMAND, "SET AUTOCOMMIT=0"); mysqli_options($link, MYSQLI_OPT_CONNECT_TIMEOUT, 5); /* connect to server */ mysqli_real_connect($link, 'localhost', 'my_user', 'my_password', 'world'); /* check connection */ if (mysqli_connect_errno()) { printf("Connect failed: %s\n", mysqli_connect_error()); exit(); } printf ("Connection: %s\n.", mysqli_get_host_info($link)); mysqli_close($link); ?> ]]> </programlisting> </example> &example.outputs; <screen> <![CDATA[ Connection: Localhost via UNIX socket ]]> </screen> </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:"../../../../manual.ced" sgml-exposed-tags:nil sgml-local-catalogs:nil sgml-local-ecat-files:nil End: vim600: syn=xml fen fdm=syntax fdl=2 si vim: et tw=78 syn=sgml vi: ts=1 sw=1 --> http://cvs.php.net/viewvc.cgi/phpdoc/en/reference/mysqli/mysqli/real-escape-string.xml?view=markup&rev=1.1 Index: phpdoc/en/reference/mysqli/mysqli/real-escape-string.xml +++ phpdoc/en/reference/mysqli/mysqli/real-escape-string.xml <?xml version="1.0" encoding="iso-8859-1"?> <!-- $Revision: 1.1 $ --> <refentry xml:id="function.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 a SQL statement, taking into account the current charset of the connection</refpurpose> </refnamediv> <refsect1 role="description"> &reftitle.description; <para>Procedural style:</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>Object oriented style (both methods are equivalent):</para> <classsynopsis> <ooclass><classname>mysqli</classname></ooclass> <methodsynopsis> <type>string</type><methodname>escape_string</methodname> <methodparam><type>string</type><parameter>escapestr</parameter></methodparam> </methodsynopsis> <methodsynopsis> <type>string</type><methodname>real_escape_string</methodname> <methodparam><type>string</type><parameter>escapestr</parameter></methodparam> </methodsynopsis> </classsynopsis> <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>Object oriented style</title> <programlisting role="php"> <![CDATA[ <?php $mysqli = new mysqli("localhost", "my_user", "my_password", "world"); /* check connection */ if (mysqli_connect_errno()) { printf("Connect failed: %s\n", mysqli_connect_error()); exit(); } $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> </example> <example> <title>Procedural style</title> <programlisting role="php"> <![CDATA[ <?php $link = mysqli_connect("localhost", "my_user", "my_password", "world"); /* check connection */ if (mysqli_connect_errno()) { printf("Connect failed: %s\n", mysqli_connect_error()); exit(); } 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> </example> &example.outputs; <screen> <![CDATA[ Error: 42000 1 Row inserted. ]]> </screen> </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:"../../../../manual.ced" sgml-exposed-tags:nil sgml-local-catalogs:nil sgml-local-ecat-files:nil End: vim600: syn=xml fen fdm=syntax fdl=2 si vim: et tw=78 syn=sgml vi: ts=1 sw=1 --> http://cvs.php.net/viewvc.cgi/phpdoc/en/reference/mysqli/mysqli/real-query.xml?view=markup&rev=1.1 Index: phpdoc/en/reference/mysqli/mysqli/real-query.xml +++ phpdoc/en/reference/mysqli/mysqli/real-query.xml <?xml version="1.0" encoding="iso-8859-1"?> <!-- $Revision: 1.1 $ --> <refentry xml:id="function.mysqli-real-query" xmlns="http://docbook.org/ns/docbook"> <refnamediv> <refname>mysqli_real_query</refname> <refname>mysqli->real_query()</refname> <refpurpose>Execute an SQL query</refpurpose> </refnamediv> <refsect1 role="description"> &reftitle.description; <para>Procedural style</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>Object oriented style (method):</para> <classsynopsis> <ooclass><classname>mysqli</classname></ooclass> <methodsynopsis> <type>bool</type><methodname>real_query</methodname> <methodparam><type>string</type><parameter>query</parameter></methodparam> </methodsynopsis> </classsynopsis> <para> Executes a single query against the database whose result can then be retrieved or stored using the <function>mysqli_store_result</function> or <function>mysqli_use_result</function> functions. </para> <para> In order to determine if a given query should return a result set or not, see <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> The query, as a string. </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:"../../../../manual.ced" sgml-exposed-tags:nil sgml-local-catalogs:nil sgml-local-ecat-files:nil End: vim600: syn=xml fen fdm=syntax fdl=2 si vim: et tw=78 syn=sgml vi: ts=1 sw=1 --> http://cvs.php.net/viewvc.cgi/phpdoc/en/reference/mysqli/mysqli/rollback.xml?view=markup&rev=1.1 Index: phpdoc/en/reference/mysqli/mysqli/rollback.xml +++ phpdoc/en/reference/mysqli/mysqli/rollback.xml <?xml version="1.0" encoding="iso-8859-1"?> <!-- $Revision: 1.1 $ --> <refentry xml:id="function.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; <methodsynopsis> <type>bool</type><methodname>mysqli_rollback</methodname> <methodparam><type>mysqli</type><parameter>link</parameter></methodparam> </methodsynopsis> <classsynopsis> <ooclass><classname>mysqli</classname></ooclass> <methodsynopsis> <type>bool</type><methodname>rollback</methodname> <void/> </methodsynopsis> </classsynopsis> <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>Object oriented style</title> <programlisting role="php"> <![CDATA[ <?php $mysqli = new mysqli("localhost", "my_user", "my_password", "world"); /* check connection */ if (mysqli_connect_errno()) { printf("Connect failed: %s\n", mysqli_connect_error()); exit(); } /* 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> </example> <example> <title>Procedural style</title> <programlisting role="php"> <![CDATA[ <?php $link = mysqli_connect("localhost", "my_user", "my_password", "world"); /* check connection */ if (mysqli_connect_errno()) { printf("Connect failed: %s\n", mysqli_connect_error()); exit(); } /* 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> </example> &example.outputs; <screen> <![CDATA[ 0 rows in table myCity. 50 rows in table myCity (after rollback). ]]> </screen> </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:"../../../../manual.ced" sgml-exposed-tags:nil sgml-local-catalogs:nil sgml-local-ecat-files:nil End: vim600: syn=xml fen fdm=syntax fdl=2 si vim: et tw=78 syn=sgml vi: ts=1 sw=1 --> http://cvs.php.net/viewvc.cgi/phpdoc/en/reference/mysqli/mysqli/select-db.xml?view=markup&rev=1.1 Index: phpdoc/en/reference/mysqli/mysqli/select-db.xml +++ phpdoc/en/reference/mysqli/mysqli/select-db.xml <?xml version="1.0" encoding="iso-8859-1"?> <!-- $Revision: 1.1 $ --> <refentry xml:id="function.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>Procedural style:</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>Object oriented style (method):</para> <classsynopsis> <ooclass><classname>mysqli</classname></ooclass> <methodsynopsis> <type>bool</type><methodname>select_db</methodname> <methodparam><type>string</type><parameter>dbname</parameter></methodparam> </methodsynopsis> </classsynopsis> <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>Object oriented style</title> <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> </example> <example> <title>Procedural style</title> <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> </example> &example.outputs; <screen> <![CDATA[ Default database is test. Default database is world. ]]> </screen> </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:"../../../../manual.ced" sgml-exposed-tags:nil sgml-local-catalogs:nil sgml-local-ecat-files:nil End: vim600: syn=xml fen fdm=syntax fdl=2 si vim: et tw=78 syn=sgml vi: ts=1 sw=1 --> http://cvs.php.net/viewvc.cgi/phpdoc/en/reference/mysqli/mysqli/set-charset.xml?view=markup&rev=1.1 Index: phpdoc/en/reference/mysqli/mysqli/set-charset.xml +++ phpdoc/en/reference/mysqli/mysqli/set-charset.xml <?xml version="1.0" encoding="iso-8859-1"?> <!-- $Revision: 1.1 $ --> <refentry xml:id="function.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>Procedural style:</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>Object oriented style (method):</para> <classsynopsis> <ooclass><classname>mysqli</classname></ooclass> <methodsynopsis> <type>bool</type><methodname>set_charset</methodname> <methodparam><type>string</type><parameter>charset</parameter></methodparam> </methodsynopsis> </classsynopsis> <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). It can be downloaded at <link xlink:href="&url.mysql.download.lib;">&url.mysql.download.lib;</link>. </para> </note> </refsect1> <refsect1 role="examples"> &reftitle.examples; <example> <title>Object oriented style</title> <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> </example> <example> <title>Procedural style</title> <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> </example> &example.outputs; <screen> <![CDATA[ Current character set: utf8 ]]> </screen> </refsect1> <refsect1 role="seealso"> &reftitle.seealso; <para> <simplelist> <member><function>mysqli_character_set_name</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:"../../../../manual.ced" sgml-exposed-tags:nil sgml-local-catalogs:nil sgml-local-ecat-files:nil End: vim600: syn=xml fen fdm=syntax fdl=2 si vim: et tw=78 syn=sgml vi: ts=1 sw=1 --> http://cvs.php.net/viewvc.cgi/phpdoc/en/reference/mysqli/mysqli/set-local-infile-default.xml?view=markup&rev=1.1 Index: phpdoc/en/reference/mysqli/mysqli/set-local-infile-default.xml +++ phpdoc/en/reference/mysqli/mysqli/set-local-infile-default.xml <?xml version="1.0" encoding="iso-8859-1"?> <!-- $Revision: 1.1 $ --> <refentry xml:id="function.mysqli-set-local-infile-default" xmlns="http://docbook.org/ns/docbook"> <refnamediv> <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> &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:"../../../../manual.ced" sgml-exposed-tags:nil sgml-local-catalogs:nil sgml-local-ecat-files:nil End: vim600: syn=xml fen fdm=syntax fdl=2 si vim: et tw=78 syn=sgml vi: ts=1 sw=1 --> http://cvs.php.net/viewvc.cgi/phpdoc/en/reference/mysqli/mysqli/set-local-infile-handler.xml?view=markup&rev=1.1 Index: phpdoc/en/reference/mysqli/mysqli/set-local-infile-handler.xml +++ phpdoc/en/reference/mysqli/mysqli/set-local-infile-handler.xml <?xml version="1.0" encoding="iso-8859-1"?> <!-- $Revision: 1.1 $ --> <refentry xml:id="function.mysqli-set-local-infile-handler" xmlns="http://docbook.org/ns/docbook"> <refnamediv> <refname>mysqli_set_local_infile_handler</refname> <refpurpose>Set callback functions for LOAD DATA LOCAL INFILE command</refpurpose> </refnamediv> <refsect1 role="description"> &reftitle.description; <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> &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:"../../../../manual.ced" sgml-exposed-tags:nil sgml-local-catalogs:nil sgml-local-ecat-files:nil End: vim600: syn=xml fen fdm=syntax fdl=2 si vim: et tw=78 syn=sgml vi: ts=1 sw=1 --> http://cvs.php.net/viewvc.cgi/phpdoc/en/reference/mysqli/mysqli/sqlstate.xml?view=markup&rev=1.1 Index: phpdoc/en/reference/mysqli/mysqli/sqlstate.xml +++ phpdoc/en/reference/mysqli/mysqli/sqlstate.xml <?xml version="1.0" encoding="iso-8859-1"?> <!-- $Revision: 1.1 $ --> <refentry xml:id="function.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>Procedural style:</para> <methodsynopsis> <type>string</type><methodname>mysqli_sqlstate</methodname> <methodparam><type>mysqli</type><parameter>link</parameter></methodparam> </methodsynopsis> <para>Object oriented style (property):</para> <classsynopsis> <ooclass><classname>mysqli</classname></ooclass> <fieldsynopsis><type>string</type><varname>sqlstate</varname></fieldsynopsis> </classsynopsis> <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>Object oriented style</title> <programlisting role="php"> <![CDATA[ <?php $mysqli = new mysqli("localhost", "my_user", "my_password", "world"); /* check connection */ if (mysqli_connect_errno()) { printf("Connect failed: %s\n", mysqli_connect_error()); exit(); } /* 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> </example> <example> <title>Procedural style</title> <programlisting role="php"> <![CDATA[ <?php $link = mysqli_connect("localhost", "my_user", "my_password", "world"); /* check connection */ if (mysqli_connect_errno()) { printf("Connect failed: %s\n", mysqli_connect_error()); exit(); } /* 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> </example> &example.outputs; <screen> <![CDATA[ Error - SQLSTATE 42S01. ]]> </screen> </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:"../../../../manual.ced" sgml-exposed-tags:nil sgml-local-catalogs:nil sgml-local-ecat-files:nil End: vim600: syn=xml fen fdm=syntax fdl=2 si vim: et tw=78 syn=sgml vi: ts=1 sw=1 --> http://cvs.php.net/viewvc.cgi/phpdoc/en/reference/mysqli/mysqli/ssl-set.xml?view=markup&rev=1.1 Index: phpdoc/en/reference/mysqli/mysqli/ssl-set.xml +++ phpdoc/en/reference/mysqli/mysqli/ssl-set.xml <?xml version="1.0" encoding="iso-8859-1"?> <!-- $Revision: 1.1 $ --> <refentry xml:id="function.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>Procedural style:</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>Object oriented style (method):</para> <classsynopsis> <ooclass><classname>mysqli</classname></ooclass> <methodsynopsis> <type>bool</type><methodname>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> </classsynopsis> <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> </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:"../../../../manual.ced" sgml-exposed-tags:nil sgml-local-catalogs:nil sgml-local-ecat-files:nil End: vim600: syn=xml fen fdm=syntax fdl=2 si vim: et tw=78 syn=sgml vi: ts=1 sw=1 --> http://cvs.php.net/viewvc.cgi/phpdoc/en/reference/mysqli/mysqli/stat.xml?view=markup&rev=1.1 Index: phpdoc/en/reference/mysqli/mysqli/stat.xml +++ phpdoc/en/reference/mysqli/mysqli/stat.xml <?xml version="1.0" encoding="iso-8859-1"?> <!-- $Revision: 1.1 $ --> <refentry xml:id="function.mysqli-stat" xmlns="http://docbook.org/ns/docbook"> <refnamediv> <refname>mysqli_stat</refname> <refname>mysqli->stat()</refname> <refpurpose>Gets the current system status</refpurpose> </refnamediv> <refsect1 role="description"> &reftitle.description; <para>Procedural style:</para> <methodsynopsis> <type>string</type><methodname>mysqli_stat</methodname> <methodparam><type>mysqli</type><parameter>link</parameter></methodparam> </methodsynopsis> <para>Object oriented style (method):</para> <classsynopsis> <ooclass><classname>mysqli</classname></ooclass> <methodsynopsis> <type>string</type><methodname>stat</methodname> <void /> </methodsynopsis> </classsynopsis> <para> <function>mysqli_stat</function> returns a string containing information similar to that provided by the 'mysqladmin status' command. This includes uptime in seconds and the number of running threads, questions, reloads, and open tables. </para> </refsect1> <refsect1 role="parameters"> &reftitle.parameters; <para> <variablelist> &mysqli.link.description; </variablelist> </para> </refsect1> <refsect1 role="returnvalues"> &reftitle.returnvalues; <para> A string describing the server status. &false; if an error occurred. </para> </refsect1> <refsect1 role="examples"> &reftitle.examples; <example> <title>Object oriented style</title> <programlisting role="php"> <![CDATA[ <?php $mysqli = new mysqli("localhost", "my_user", "my_password", "world"); /* check connection */ if (mysqli_connect_errno()) { printf("Connect failed: %s\n", mysqli_connect_error()); exit(); } printf ("System status: %s\n", $mysqli->stat()); $mysqli->close(); ?> ]]> </programlisting> </example> <example> <title>Procedural style</title> <programlisting role="php"> <![CDATA[ <?php $link = mysqli_connect("localhost", "my_user", "my_password", "world"); /* check connection */ if (mysqli_connect_errno()) { printf("Connect failed: %s\n", mysqli_connect_error()); exit(); } printf("System status: %s\n", mysqli_stat($link)); mysqli_close($link); ?> ]]> </programlisting> </example> &example.outputs; <screen> <![CDATA[ System status: Uptime: 272 Threads: 1 Questions: 5340 Slow queries: 0 Opens: 13 Flush tables: 1 Open tables: 0 Queries per second avg: 19.632 Memory in use: 8496K Max memory used: 8560K ]]> </screen> </refsect1> <refsect1 role="seealso"> &reftitle.seealso; <para> <simplelist> <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:"../../../../manual.ced" sgml-exposed-tags:nil sgml-local-catalogs:nil sgml-local-ecat-files:nil End: vim600: syn=xml fen fdm=syntax fdl=2 si vim: et tw=78 syn=sgml vi: ts=1 sw=1 --> http://cvs.php.net/viewvc.cgi/phpdoc/en/reference/mysqli/mysqli/stmt-init.xml?view=markup&rev=1.1 Index: phpdoc/en/reference/mysqli/mysqli/stmt-init.xml +++ phpdoc/en/reference/mysqli/mysqli/stmt-init.xml <?xml version="1.0" encoding="iso-8859-1"?> <!-- $Revision: 1.1 $ --> <refentry xml:id="function.mysqli-stmt-init" xmlns="http://docbook.org/ns/docbook"> <refnamediv> <refname>mysqli_stmt_init</refname> <refname>mysqli->stmt_init()</refname> <refpurpose>Initializes a statement and returns an object for use with mysqli_stmt_prepare</refpurpose> </refnamediv> <refsect1 role="description"> &reftitle.description; <para>Procedural style :</para> <methodsynopsis> <type>mysqli_stmt</type><methodname>mysqli_stmt_init</methodname> <methodparam><type>mysqli</type><parameter>link</parameter></methodparam> </methodsynopsis> <para>Object oriented style (property):</para> <classsynopsis> <ooclass><classname>mysqli</classname></ooclass> <methodsynopsis> <type>mysqli_stmt</type><methodname>stmt_init</methodname> <void/> </methodsynopsis> </classsynopsis> <para> Allocates and initializes a statement object suitable for <function>mysqli_stmt_prepare</function>. </para> <note> <para> Any subsequent calls to any mysqli_stmt function will fail until <function>mysqli_stmt_prepare</function> was called. </para> </note> </refsect1> <refsect1 role="parameters"> &reftitle.parameters; <para> <variablelist> &mysqli.link.description; </variablelist> </para> </refsect1> <refsect1 role="returnvalues"> &reftitle.returnvalues; <para> Returns an object. </para> </refsect1> <refsect1 role="seealso"> &reftitle.seealso; <para> <simplelist> <member><function>mysqli_stmt_prepare</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:"../../../../manual.ced" sgml-exposed-tags:nil sgml-local-catalogs:nil sgml-local-ecat-files:nil End: vim600: syn=xml fen fdm=syntax fdl=2 si vim: et tw=78 syn=sgml vi: ts=1 sw=1 --> http://cvs.php.net/viewvc.cgi/phpdoc/en/reference/mysqli/mysqli/store-result.xml?view=markup&rev=1.1 Index: phpdoc/en/reference/mysqli/mysqli/store-result.xml +++ phpdoc/en/reference/mysqli/mysqli/store-result.xml <?xml version="1.0" encoding="iso-8859-1"?> <!-- $Revision: 1.1 $ --> <refentry xml:id="function.mysqli-store-result" xmlns="http://docbook.org/ns/docbook"> <refnamediv> <refname>mysqli_store_result</refname> <refname>mysqli->store_result()</refname> <refpurpose>Transfers a result set from the last query</refpurpose> </refnamediv> <refsect1 role="description"> &reftitle.description; <para>Procedural style:</para> <methodsynopsis> <type>mysqli_result</type><methodname>mysqli_store_result</methodname> <methodparam><type>mysqli</type><parameter>link</parameter></methodparam> </methodsynopsis> <para>Object oriented style (method):</para> <classsynopsis> <ooclass><classname>mysqli</classname></ooclass> <methodsynopsis> <type>mysqli_result</type><methodname>store_result</methodname> <void /> </methodsynopsis> </classsynopsis> <para> Transfers the result set from the last query on the database connection represented by the <parameter>link</parameter> parameter to be used with the <function>mysqli_data_seek</function> function. </para> </refsect1> <refsect1 role="parameters"> &reftitle.parameters; <para> <variablelist> &mysqli.link.description; </variablelist> </para> </refsect1> <refsect1 role="returnvalues"> &reftitle.returnvalues; <para> Returns a buffered result object or &false; if an error occurred. </para> <note> <para> <function>mysqli_store_result</function> returns &false; in case the query didn't return a result set (if the query was, for example an INSERT statement). This function also returns &false; if the reading of the result set failed. You can check if you have got an error by checking if <function>mysqli_error</function> doesn't return an empty string, if <function>mysqli_errno</function> returns a non zero value, or if <function>mysqli_field_count</function> returns a non zero value. Also possible reason for this function returning &false; after successfull call to <function>mysqli_query</function> can be too large result set (memory for it cannot be allocated). If <function>mysqli_field_count</function> returns a non-zero value, the statement should have produced a non-empty result set. </para> </note> </refsect1> <refsect1 role="notes"> &reftitle.notes; <note> <para> Although it is always good practice to free the memory used by the result of a query using the <function>mysqli_free_result</function> function, when transfering large result sets using the <function>mysqli_store_result</function> this becomes particularly important. </para> </note> </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_real_query</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:"../../../../manual.ced" sgml-exposed-tags:nil sgml-local-catalogs:nil sgml-local-ecat-files:nil End: vim600: syn=xml fen fdm=syntax fdl=2 si vim: et tw=78 syn=sgml vi: ts=1 sw=1 --> http://cvs.php.net/viewvc.cgi/phpdoc/en/reference/mysqli/mysqli/thread-id.xml?view=markup&rev=1.1 Index: phpdoc/en/reference/mysqli/mysqli/thread-id.xml +++ phpdoc/en/reference/mysqli/mysqli/thread-id.xml <?xml version="1.0" encoding="iso-8859-1"?> <!-- $Revision: 1.1 $ --> <refentry xml:id="function.mysqli-thread-id" xmlns="http://docbook.org/ns/docbook"> <refnamediv> <refname>mysqli_thread_id</refname> <refname>mysqli->thread_id</refname> <refpurpose>Returns the thread ID for the current connection</refpurpose> </refnamediv> <refsect1 role="description"> &reftitle.description; <para>Procedural style:</para> <methodsynopsis> <type>int</type><methodname>mysqli_thread_id</methodname> <methodparam><type>mysqli</type><parameter>link</parameter></methodparam> </methodsynopsis> <para>Object oriented style (property):</para> <classsynopsis> <ooclass><classname>mysqli</classname></ooclass> <fieldsynopsis><type>int</type><varname>thread_id</varname></fieldsynopsis> </classsynopsis> <para> The <function>mysqli_thread_id</function> function returns the thread ID for the current connection which can then be killed using the <function>mysqli_kill</function> function. If the connection is lost and you reconnect with <function>mysqli_ping</function>, the thread ID will be other. Therefore you should get the thread ID only when you need it. </para> <note> <para> The thread ID is assigned on a connection-by-connection basis. Hence, if the connection is broken and then re-established a new thread ID will be assigned. </para> <para> To kill a running query you can use the SQL command <literal>KILL QUERY processid</literal>. </para> </note> </refsect1> <refsect1 role="parameters"> &reftitle.parameters; <para> <variablelist> &mysqli.link.description; </variablelist> </para> </refsect1> <refsect1 role="returnvalues"> &reftitle.returnvalues; <para> Returns the Thread ID for the current connection. </para> </refsect1> <refsect1 role="examples"> &reftitle.examples; <example> <title>Object oriented style</title> <programlisting role="php"> <![CDATA[ <?php $mysqli = new mysqli("localhost", "my_user", "my_password", "world"); /* check connection */ if (mysqli_connect_errno()) { printf("Connect failed: %s\n", mysqli_connect_error()); exit(); } /* determine our thread id */ $thread_id = $mysqli->thread_id; /* Kill connection */ $mysqli->kill($thread_id); /* This should produce an error */ if (!$mysqli->query("CREATE TABLE myCity LIKE City")) { printf("Error: %s\n", $mysqli->error); exit; } /* close connection */ $mysqli->close(); ?> ]]> </programlisting> </example> <example> <title>Procedural style</title> <programlisting role="php"> <![CDATA[ <?php $link = mysqli_connect("localhost", "my_user", "my_password", "world"); /* check connection */ if (mysqli_connect_errno()) { printf("Connect failed: %s\n", mysqli_connect_error()); exit(); } /* determine our thread id */ $thread_id = mysqli_thread_id($link); /* Kill connection */ mysqli_kill($link, $thread_id); /* This should produce an error */ if (!mysqli_query($link, "CREATE TABLE myCity LIKE City")) { printf("Error: %s\n", mysqli_error($link)); exit; } /* close connection */ mysqli_close($link); ?> ]]> </programlisting> </example> &example.outputs; <screen> <![CDATA[ Error: MySQL server has gone away ]]> </screen> </refsect1> <refsect1 role="seealso"> &reftitle.seealso; <para> <simplelist> <member><function>mysqli_kill</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:"../../../../manual.ced" sgml-exposed-tags:nil sgml-local-catalogs:nil sgml-local-ecat-files:nil End: vim600: syn=xml fen fdm=syntax fdl=2 si vim: et tw=78 syn=sgml vi: ts=1 sw=1 --> http://cvs.php.net/viewvc.cgi/phpdoc/en/reference/mysqli/mysqli/thread-safe.xml?view=markup&rev=1.1 Index: phpdoc/en/reference/mysqli/mysqli/thread-safe.xml +++ phpdoc/en/reference/mysqli/mysqli/thread-safe.xml <?xml version="1.0" encoding="iso-8859-1"?> <!-- $Revision: 1.1 $ --> <refentry xml:id="function.mysqli-thread-safe" xmlns="http://docbook.org/ns/docbook"> <refnamediv> <refname>mysqli_thread_safe</refname> <refpurpose>Returns whether thread safety is given or not</refpurpose> </refnamediv> <refsect1 role="description"> &reftitle.description; <para>Procedural style:</para> <methodsynopsis> <type>bool</type><methodname>mysqli_thread_safe</methodname> <void /> </methodsynopsis> <para> Tells whether the client library is compiled as thread-safe. </para> </refsect1> <refsect1 role="returnvalues"> &reftitle.returnvalues; <para> &true; if the client library is thread-safe, otherwise &false;. </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:"../../../../manual.ced" sgml-exposed-tags:nil sgml-local-catalogs:nil sgml-local-ecat-files:nil End: vim600: syn=xml fen fdm=syntax fdl=2 si vim: et tw=78 syn=sgml vi: ts=1 sw=1 --> http://cvs.php.net/viewvc.cgi/phpdoc/en/reference/mysqli/mysqli/use-result.xml?view=markup&rev=1.1 Index: phpdoc/en/reference/mysqli/mysqli/use-result.xml +++ phpdoc/en/reference/mysqli/mysqli/use-result.xml <?xml version="1.0" encoding="iso-8859-1"?> <!-- $Revision: 1.1 $ --> <refentry xml:id="function.mysqli-use-result" xmlns="http://docbook.org/ns/docbook"> <refnamediv> <refname>mysqli_use_result</refname> <refname>mysqli->use_result()</refname> <refpurpose>Initiate a result set retrieval</refpurpose> </refnamediv> <refsect1 role="description"> &reftitle.description; <para>Procedural style:</para> <methodsynopsis> <type>mysqli_result</type><methodname>mysqli_use_result</methodname> <methodparam><type>mysqli</type><parameter>link</parameter></methodparam> </methodsynopsis> <para>Object oriented style (method):</para> <classsynopsis> <ooclass><classname>mysqli</classname></ooclass> <methodsynopsis> <type>mysqli_result</type><methodname>use_result</methodname> <void /> </methodsynopsis> </classsynopsis> <para> Used to initiate the retrieval of a result set from the last query executed using the <function>mysqli_real_query</function> function on the database connection. </para> <para> Either this or the <function>mysqli_store_result</function> function must be called before the results of a query can be retrieved, and one or the other must be called to prevent the next query on that database connection from failing. </para> <note> <para> The <function>mysqli_use_result</function> function does not transfer the entire result set from the database and hence cannot be used functions such as <function>mysqli_data_seek</function> to move to a particular row within the set. To use this functionality, the result set must be stored using <function>mysqli_store_result</function>. One should not use <function>mysqli_use_result</function> if a lot of processing on the client side is performed, since this will tie up the server and prevent other threads from updating any tables from which the data is being fetched. </para> </note> </refsect1> <refsect1 role="returnvalues"> &reftitle.returnvalues; <para> Returns an unbuffered result object or &false; if an error occurred. </para> </refsect1> <refsect1 role="examples"> &reftitle.examples; <example> <title>Object oriented style</title> <programlisting role="php"> <![CDATA[ <?php $mysqli = new mysqli("localhost", "my_user", "my_password", "world"); /* check connection */ if (mysqli_connect_errno()) { printf("Connect failed: %s\n", mysqli_connect_error()); exit(); } $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->use_result()) { while ($row = $result->fetch_row()) { printf("%s\n", $row[0]); } $result->close(); } /* print divider */ if ($mysqli->more_results()) { printf("-----------------\n"); } } while ($mysqli->next_result()); } /* close connection */ $mysqli->close(); ?> ]]> </programlisting> </example> <example> <title>Procedural style</title> <programlisting role="php"> <![CDATA[ <?php $link = mysqli_connect("localhost", "my_user", "my_password", "world"); /* check connection */ if (mysqli_connect_errno()) { printf("Connect failed: %s\n", mysqli_connect_error()); exit(); } $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_use_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> </example> &example.outputs; <screen> <![CDATA[ my_user@localhost ----------------- Amersfoort Maastricht Dordrecht Leiden Haarlemmermeer ]]> </screen> </refsect1> <refsect1 role="seealso"> &reftitle.seealso; <para> <simplelist> <member><function>mysqli_real_query</function></member> <member><function>mysqli_store_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:"../../../../manual.ced" sgml-exposed-tags:nil sgml-local-catalogs:nil sgml-local-ecat-files:nil End: vim600: syn=xml fen fdm=syntax fdl=2 si vim: et tw=78 syn=sgml vi: ts=1 sw=1 --> http://cvs.php.net/viewvc.cgi/phpdoc/en/reference/mysqli/mysqli/warning-count.xml?view=markup&rev=1.1 Index: phpdoc/en/reference/mysqli/mysqli/warning-count.xml +++ phpdoc/en/reference/mysqli/mysqli/warning-count.xml <?xml version="1.0" encoding="iso-8859-1"?> <!-- $Revision: 1.1 $ --> <refentry xml:id="function.mysqli-warning-count" xmlns="http://docbook.org/ns/docbook"> <refnamediv> <refname>mysqli_warning_count</refname> <refname>mysqli->warning_count</refname> <refpurpose>Returns the number of warnings from the last query for the given link</refpurpose> </refnamediv> <refsect1 role="description"> &reftitle.description; <para>Procedural style:</para> <methodsynopsis> <type>int</type><methodname>mysqli_warning_count</methodname> <methodparam><type>mysqli</type><parameter>link</parameter></methodparam> </methodsynopsis> <para>Object oriented style (property):</para> <classsynopsis> <ooclass><classname>mysqli</classname></ooclass> <fieldsynopsis><type>int</type><varname>warning_count</varname></fieldsynopsis> </classsynopsis> <para> Returns the number of warnings from the last query in the connection. </para> <note> <para> For retrieving warning messages you can use the SQL command <literal>SHOW WARNINGS [limit row_count]</literal>. </para> </note> </refsect1> <refsect1 role="parameters"> &reftitle.parameters; <para> <variablelist> &mysqli.link.description; </variablelist> </para> </refsect1> <refsect1 role="returnvalues"> &reftitle.returnvalues; <para> Number of warnings or zero if there are no warnings. </para> </refsect1> <refsect1 role="examples"> &reftitle.examples; <example> <title>Object oriented style</title> <programlisting role="php"> <![CDATA[ <?php $mysqli = new mysqli("localhost", "my_user", "my_password", "world"); /* check connection */ if (mysqli_connect_errno()) { printf("Connect failed: %s\n", mysqli_connect_error()); exit(); } $mysqli->query("CREATE TABLE myCity LIKE City"); /* a remarkable city in Wales */ $query = "INSERT INTO myCity (CountryCode, Name) VALUES('GBR', 'Llanfairpwllgwyngyllgogerychwyrndrobwllllantysiliogogogoch')"; $mysqli->query($query); if ($mysqli->warning_count) { if ($result = $mysqli->query("SHOW WARNINGS")) { $row = $result->fetch_row(); printf("%s (%d): %s\n", $row[0], $row[1], $row[2]); $result->close(); } } /* close connection */ $mysqli->close(); ?> ]]> </programlisting> </example> <example> <title>Procedural style</title> <programlisting role="php"> <![CDATA[ <?php $link = mysqli_connect("localhost", "my_user", "my_password", "world"); /* check connection */ if (mysqli_connect_errno()) { printf("Connect failed: %s\n", mysqli_connect_error()); exit(); } mysqli_query($link, "CREATE TABLE myCity LIKE City"); /* a remarkable long city name in Wales */ $query = "INSERT INTO myCity (CountryCode, Name) VALUES('GBR', 'Llanfairpwllgwyngyllgogerychwyrndrobwllllantysiliogogogoch')"; mysqli_query($link, $query); if (mysqli_warning_count($link)) { if ($result = mysqli_query($link, "SHOW WARNINGS")) { $row = mysqli_fetch_row($result); printf("%s (%d): %s\n", $row[0], $row[1], $row[2]); mysqli_free_result($result); } } /* close connection */ mysqli_close($link); ?> ]]> </programlisting> </example> &example.outputs; <screen> <![CDATA[ Warning (1264): Data truncated for column 'Name' at row 1 ]]> </screen> </refsect1> <refsect1 role="seealso"> &reftitle.seealso; <para> <simplelist> <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:"../../../../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 -->