Implemented new doc style, implemented new entities, and rewording where appropriate.

git-svn-id: https://svn.php.net/repository/phpdoc/en/trunk@183245 c90b9560-bf6c-de11-be94-00142212c4b1
This commit is contained in:
Philip Olson 2005-03-31 07:47:25 +00:00
parent fbace95d53
commit 42c93b5280
47 changed files with 1797 additions and 836 deletions

View file

@ -1,5 +1,5 @@
<?xml version="1.0" encoding="iso-8859-1"?>
<!-- $Revision: 1.20 $ -->
<!-- $Revision: 1.21 $ -->
<refentry id="function.mysql-affected-rows">
<refnamediv>
<refname>mysql_affected_rows</refname>
@ -22,12 +22,7 @@
&reftitle.parameters;
<para>
<variablelist>
<varlistentry>
<term><parameter>link_identifier</parameter></term>
<listitem>
&mysql.linkid.description;
</listitem>
</varlistentry>
&mysql.linkid.description;
</variablelist>
</para>
</refsect1>

View file

@ -1,5 +1,5 @@
<?xml version="1.0" encoding="iso-8859-1"?>
<!-- $Revision: 1.5 $ -->
<!-- $Revision: 1.6 $ -->
<refentry id="function.mysql-change-user">
<refnamediv>
<refname>mysql_change_user</refname>
@ -57,12 +57,7 @@
</para>
</listitem>
</varlistentry>
<varlistentry>
<term><parameter>link_identifier</parameter></term>
<listitem>
&mysql.linkid.description;
</listitem>
</varlistentry>
&mysql.linkid.description;
</variablelist>
</para>
</refsect1>

View file

@ -1,5 +1,5 @@
<?xml version="1.0" encoding="iso-8859-1"?>
<!-- $Revision: 1.8 $ -->
<!-- $Revision: 1.9 $ -->
<refentry id="function.mysql-client-encoding">
<refnamediv>
<refname>mysql_client_encoding</refname>
@ -21,12 +21,7 @@
&reftitle.parameters;
<para>
<variablelist>
<varlistentry>
<term><parameter>link_identifier</parameter></term>
<listitem>
&mysql.linkid.description;
</listitem>
</varlistentry>
&mysql.linkid.description;
</variablelist>
</para>
</refsect1>

View file

@ -1,5 +1,5 @@
<?xml version="1.0" encoding="iso-8859-1"?>
<!-- $Revision: 1.10 $ -->
<!-- $Revision: 1.11 $ -->
<refentry id="function.mysql-close">
<refnamediv>
<refname>mysql_close</refname>
@ -31,12 +31,7 @@
&reftitle.parameters;
<para>
<variablelist>
<varlistentry>
<term><parameter>link_identifier</parameter></term>
<listitem>
&mysql.linkid.description;
</listitem>
</varlistentry>
&mysql.linkid.description;
</variablelist>
</para>
</refsect1>

View file

@ -1,13 +1,13 @@
<?xml version="1.0" encoding="iso-8859-1"?>
<!-- $Revision: 1.14 $ -->
<!-- splitted from ./en/functions/mysql.xml, last change in rev 1.2 -->
<!-- $Revision: 1.15 $ -->
<refentry id="function.mysql-connect">
<refnamediv>
<refname>mysql_connect</refname>
<refpurpose>Open a connection to a MySQL Server</refpurpose>
</refnamediv>
<refsect1>
<title>Description</title>
<refsect1 role="description">
&reftitle.description;
<methodsynopsis>
<type>resource</type><methodname>mysql_connect</methodname>
<methodparam choice="opt"><type>string</type><parameter>server</parameter></methodparam>
@ -16,74 +16,131 @@
<methodparam choice="opt"><type>bool</type><parameter>new_link</parameter></methodparam>
<methodparam choice="opt"><type>int</type><parameter>client_flags</parameter></methodparam>
</methodsynopsis>
<para>
Opens or reuses a connection to a MySQL server. The link to the server will
be closed as soon as the execution of the script ends, unless it's closed
earlier by explicitly calling <function>mysql_close</function>.
</para>
</refsect1>
<refsect1 role="parameters">
&reftitle.parameters;
<para>
<variablelist>
<varlistentry>
<term><parameter>server</parameter></term>
<listitem>
<para>
The MySQL server. It can also include a port number. e.g.
"hostname:port" or a path to a local socket e.g. ":/path/to/socket" for
the localhost.
</para>
<para>
If the PHP directive <link linkend="ini.mysql.default-host">
mysql.default_host</link> is undefined (default), then the default
value is 'localhost:3306'
</para>
</listitem>
</varlistentry>
<varlistentry>
<term><parameter>username</parameter></term>
<listitem>
<para>
The username. Default value is the name of the user that owns the
server process.
</para>
</listitem>
</varlistentry>
<varlistentry>
<term><parameter>password</parameter></term>
<listitem>
<para>
The password. Default value is an empty password.
</para>
</listitem>
</varlistentry>
<varlistentry>
<term><parameter>new_link</parameter></term>
<listitem>
<para>
If a second call is made to <function>mysql_connect</function>
with the same arguments, no new link will be established, but
instead, the link identifier of the already opened link will be
returned. The <parameter>new_link</parameter> parameter modifies this
behavior and makes <function>mysql_connect</function> always open
a new link, even if <function>mysql_connect</function> was called
before with the same parameters.
</para>
</listitem>
</varlistentry>
<varlistentry>
<term><parameter>client_flags</parameter></term>
<listitem>
<para>
The <parameter>client_flags</parameter> parameter can be a combination
of the following constants:
<constant>MYSQL_CLIENT_COMPRESS</constant>,
<constant>MYSQL_CLIENT_IGNORE_SPACE</constant> or
<constant>MYSQL_CLIENT_INTERACTIVE</constant>.
</para>
</listitem>
</varlistentry>
</variablelist>
</para>
</refsect1>
<refsect1 role="returnvalues">
&reftitle.returnvalues;
<para>
Returns a MySQL link identifier on success, or &false; on failure.
</para>
</refsect1>
<refsect1 role="changelog">
&reftitle.changelog;
<para>
<function>mysql_connect</function> establishes a connection
to a MySQL server. The following defaults are assumed for
missing optional parameters: <parameter>server</parameter> =
'localhost:3306', <parameter>username</parameter> = name of the
user that owns the server process and
<parameter>password</parameter> = empty password.
</para>
<para>
The <parameter>server</parameter> parameter can also include a port
number. e.g. &quot;hostname:port&quot; or a path to a local socket
e.g. &quot;:/path/to/socket&quot; for the localhost.
<note>
<para>
Whenever you specify &quot;localhost&quot; or
&quot;localhost:port&quot; as server, the MySQL client library will
override this and try to connect to a local socket (named pipe on
Windows). If you want to use TCP/IP, use &quot;127.0.0.1&quot;
instead of &quot;localhost&quot;. If the MySQL client library tries to
connect to the wrong local socket, you should set the correct path as
mysql.default_host in your PHP configuration and leave the server field
blank.
</para>
<para>
Support for &quot;:port&quot; was added in PHP 3.0B4.
</para>
<para>
Support for &quot;:/path/to/socket&quot; was added in
PHP 3.0.10.
</para>
<para>
You can suppress the error message on failure by prepending
a <link linkend="language.operators.errorcontrol">@</link>
to the function name.
</para>
</note>
</para>
<para>
If a second call is made to <function>mysql_connect</function>
with the same arguments, no new link will be established, but
instead, the link identifier of the already opened link will be
returned. The <parameter>new_link</parameter> parameter modifies this
behavior and makes <function>mysql_connect</function> always open
a new link, even if <function>mysql_connect</function> was called
before with the same parameters. The <parameter>client_flags</parameter>
parameter can be a combination of the constants
<constant>MYSQL_CLIENT_COMPRESS</constant>,
<constant>MYSQL_CLIENT_IGNORE_SPACE</constant> or
<constant>MYSQL_CLIENT_INTERACTIVE</constant>.
</para>
<note>
<para>
The <parameter>new_link</parameter> parameter became available
in PHP 4.2.0
</para>
<para>
The <parameter>client_flags</parameter> parameter became available in
PHP 4.3.0
</para>
</note>
<para>
The link to the server will be closed as soon as the execution of
the script ends, unless it's closed earlier by explicitly calling
<function>mysql_close</function>.
<informaltable>
<tgroup cols="2">
<thead>
<row>
<entry>&Version;</entry>
<entry>&Description;</entry>
</row>
</thead>
<tbody>
<row>
<entry>4.3.0</entry>
<entry>
Added the <parameter>client_flags</parameter> parameter.
</entry>
</row>
<row>
<entry>4.2.0</entry>
<entry>
Added the <parameter>new_link</parameter> parameter.
</entry>
</row>
<row>
<entry>3.0.10</entry>
<entry>
Added support for ":/path/to/socket" with
<parameter>server</parameter>.
</entry>
</row>
<row>
<entry>3.0.0</entry>
<entry>
Added support for ":port" with <parameter>server</parameter>.
</entry>
</row>
</tbody>
</tgroup>
</informaltable>
</para>
</refsect1>
<refsect1 role="examples">
&reftitle.examples;
<para>
<example>
<title><function>mysql_connect</function> example</title>
@ -101,10 +158,45 @@ mysql_close($link);
</programlisting>
</example>
</para>
<para>
See also
<function>mysql_pconnect</function> and
<function>mysql_close</function>.
</refsect1>
<refsect1 role="notes">
&reftitle.notes;
<note>
<para>
Whenever you specify &quot;localhost&quot; or
&quot;localhost:port&quot; as server, the MySQL client library will
override this and try to connect to a local socket (named pipe on
Windows). If you want to use TCP/IP, use &quot;127.0.0.1&quot;
instead of &quot;localhost&quot;. If the MySQL client library tries to
connect to the wrong local socket, you should set the correct path as
mysql.default_host in your PHP configuration and leave the server field
blank.
</para>
</note>
<note>
<para>
The link to the server will be closed as soon as the execution of
the script ends, unless it's closed earlier by explicitly calling
<function>mysql_close</function>.
</para>
</note>
<note>
<para>
You can suppress the error message on failure by prepending
a <link linkend="language.operators.errorcontrol">@</link>
to the function name.
</para>
</note>
</refsect1>
<refsect1 role="seealso">
&reftitle.seealso;
<para>
<simplelist>
<member><function>mysql_pconnect</function></member>
<member><function>mysql_close</function></member>
</simplelist>
</para>
</refsect1>
</refentry>

View file

@ -1,5 +1,5 @@
<?xml version="1.0" encoding="iso-8859-1"?>
<!-- $Revision: 1.14 $ -->
<!-- $Revision: 1.15 $ -->
<refentry id="function.mysql-create-db">
<refnamediv>
<refname>mysql_create_db</refname>
@ -30,12 +30,7 @@
</para>
</listitem>
</varlistentry>
<varlistentry>
<term><parameter>link_identifier</parameter></term>
<listitem>
&mysql.linkid.description;
</listitem>
</varlistentry>
&mysql.linkid.description;
</variablelist>
</para>
</refsect1>
@ -88,8 +83,8 @@ Database my_db created successfully
&reftitle.notes;
<note>
<para>
For downwards compatibility <function>mysql_createdb</function>
can also be used. This is deprecated, however.
&info.deprecated.alias;
<function>mysql_createdb</function>
</para>
</note>
<note>

View file

@ -1,5 +1,5 @@
<?xml version="1.0" encoding="iso-8859-1"?>
<!-- $Revision: 1.16 $ -->
<!-- $Revision: 1.17 $ -->
<refentry id="function.mysql-data-seek">
<refnamediv>
<refname>mysql_data_seek</refname>
@ -9,7 +9,7 @@
&reftitle.description;
<methodsynopsis>
<type>bool</type><methodname>mysql_data_seek</methodname>
<methodparam><type>resource</type><parameter>result_identifier</parameter></methodparam>
<methodparam><type>resource</type><parameter>result</parameter></methodparam>
<methodparam><type>int</type><parameter>row_number</parameter></methodparam>
</methodsynopsis>
<para>
@ -32,14 +32,7 @@
&reftitle.parameters;
<para>
<variablelist>
<varlistentry>
<term><parameter>result_identifier</parameter></term>
<listitem>
<para>
The MySQL result identifier that is being seeked.
</para>
</listitem>
</varlistentry>
&mysql.result.description;
<varlistentry>
<term><parameter>row_number</parameter></term>
<listitem>

View file

@ -1,5 +1,5 @@
<?xml version="1.0" encoding="iso-8859-1"?>
<!-- $Revision: 1.8 $ -->
<!-- $Revision: 1.9 $ -->
<refentry id="function.mysql-db-name">
<refnamediv>
<refname>mysql_db_name</refname>
@ -90,8 +90,8 @@ while ($i < $cnt) {
&reftitle.notes;
<note>
<para>
For backward compatibility, <function>mysql_dbname</function> is
also accepted. This is deprecated, however.
&info.deprecated.alias;
<function>mysql_dbname</function>
</para>
</note>
</refsect1>

View file

@ -1,5 +1,5 @@
<?xml version="1.0" encoding="iso-8859-1"?>
<!-- $Revision: 1.9 $ -->
<!-- $Revision: 1.10 $ -->
<refentry id="function.mysql-db-query">
<refnamediv>
<refname>mysql_db_query</refname>
@ -40,12 +40,7 @@
</para>
</listitem>
</varlistentry>
<varlistentry>
<term><parameter>link_identifier</parameter></term>
<listitem>
&mysql.linkid.description;
</listitem>
</varlistentry>
&mysql.linkid.description;
</variablelist>
</para>
</refsect1>

View file

@ -1,5 +1,5 @@
<?xml version="1.0" encoding="iso-8859-1"?>
<!-- $Revision: 1.15 $ -->
<!-- $Revision: 1.16 $ -->
<refentry id="function.mysql-drop-db">
<refnamediv>
<refname>mysql_drop_db</refname>
@ -34,12 +34,7 @@
</para>
</listitem>
</varlistentry>
<varlistentry>
<term><parameter>link_identifier</parameter></term>
<listitem>
&mysql.linkid.description;
</listitem>
</varlistentry>
&mysql.linkid.description;
</variablelist>
</para>
</refsect1>
@ -87,8 +82,8 @@ if (mysql_query($sql, $link)) {
</warning>
<note>
<para>
For downward compatibility <function>mysql_dropdb</function>
can also be used. This is also deprecated, however.
&info.deprecated.alias;
<function>mysql_dropdb</function>
</para>
</note>
</refsect1>

View file

@ -1,5 +1,5 @@
<?xml version="1.0" encoding="iso-8859-1"?>
<!-- $Revision: 1.13 $ -->
<!-- $Revision: 1.14 $ -->
<refentry id="function.mysql-errno">
<refnamediv>
<refname>mysql_errno</refname>
@ -31,12 +31,7 @@
&reftitle.parameters;
<para>
<variablelist>
<varlistentry>
<term><parameter>link_identifier</parameter></term>
<listitem>
&mysql.linkid.description;
</listitem>
</varlistentry>
&mysql.linkid.description;
</variablelist>
</para>
</refsect1>

View file

@ -1,5 +1,5 @@
<?xml version="1.0" encoding="iso-8859-1"?>
<!-- $Revision: 1.16 $ -->
<!-- $Revision: 1.17 $ -->
<refentry id="function.mysql-error">
<refnamediv>
<refname>mysql_error</refname>
@ -28,12 +28,7 @@
&reftitle.parameters;
<para>
<variablelist>
<varlistentry>
<term><parameter>link_identifier</parameter></term>
<listitem>
&mysql.linkid.description;
</listitem>
</varlistentry>
&mysql.linkid.description;
</variablelist>
</para>
</refsect1>

View file

@ -1,5 +1,5 @@
<?xml version="1.0" encoding="iso-8859-1"?>
<!-- $Revision: 1.21 $ -->
<!-- $Revision: 1.22 $ -->
<refentry id="function.mysql-fetch-array">
<refnamediv>
<refname>mysql_fetch_array</refname>
@ -22,14 +22,7 @@
&reftitle.parameters;
<para>
<variablelist>
<varlistentry>
<term><parameter>result</parameter></term>
<listitem>
<para>
The result that's being fetched.
</para>
</listitem>
</varlistentry>
&mysql.result.description;
<varlistentry>
<term><parameter>result_type</parameter></term>
<listitem>

View file

@ -1,29 +1,39 @@
<?xml version="1.0" encoding="iso-8859-1"?>
<!-- $Revision: 1.13 $ -->
<!-- splitted from ./en/functions/mysql.xml, last change in rev 1.45 -->
<!-- $Revision: 1.14 $ -->
<refentry id="function.mysql-fetch-assoc">
<refnamediv>
<refname>mysql_fetch_assoc</refname>
<refpurpose>
Fetch a result row as an associative array
</refpurpose>
<refpurpose>Fetch a result row as an associative array</refpurpose>
</refnamediv>
<refsect1>
<title>Description</title>
<refsect1 role="description">
&reftitle.description;
<methodsynopsis>
<type>array</type><methodname>mysql_fetch_assoc</methodname>
<methodparam><type>resource</type><parameter>result</parameter></methodparam>
</methodsynopsis>
<para>
Returns an associative array that corresponds to the fetched row,
or &false; if there are no more rows.</para>
<para>
Returns an associative array that corresponds to the fetched row.
<function>mysql_fetch_assoc</function> is equivalent to calling
<function>mysql_fetch_array</function> with MYSQL_ASSOC for the
optional second parameter. It only returns an associative array.
This is the way <function>mysql_fetch_array</function> originally
worked. If you need the numeric indices as well as the
associative, use <function>mysql_fetch_array</function>.
optional second parameter. It only returns an associative array.
</para>
</refsect1>
<refsect1 role="parameters">
&reftitle.parameters;
<para>
<variablelist>
&mysql.result.description;
</variablelist>
</para>
</refsect1>
<refsect1 role="returnvalues">
&reftitle.returnvalues;
<para>
Returns an associative array that corresponds to the fetched row, or
&false; if there are no more rows.
</para>
<para>
If two or more columns of the result have the same field names,
@ -34,15 +44,10 @@
See the example at the <function>mysql_fetch_array</function>
description about aliases.
</para>
<para>
An important thing to note is that using
<function>mysql_fetch_assoc</function> is <emphasis>not
significantly</emphasis> slower than using
<function>mysql_fetch_row</function>, while it
provides a significant added value.
</para>
&database.field-case;
&database.fetch-null;
</refsect1>
<refsect1 role="examples">
&reftitle.examples;
<para>
<example>
<title>An expanded <function>mysql_fetch_assoc</function> example</title>
@ -95,13 +100,34 @@ mysql_free_result($result);
</programlisting>
</example>
</para>
</refsect1>
<refsect1 role="notes">
&reftitle.notes;
<note>
<title>Performance</title>
<para>
An important thing to note is that using
<function>mysql_fetch_assoc</function> is <emphasis>not
significantly</emphasis> slower than using
<function>mysql_fetch_row</function>, while it
provides a significant added value.
</para>
</note>
&database.field-case;
&database.fetch-null;
</refsect1>
<refsect1 role="seealso">
&reftitle.seealso;
<para>
See also
<function>mysql_fetch_row</function>,
<function>mysql_fetch_array</function>,
<function>mysql_data_seek</function>,
<function>mysql_query</function> and
<function>mysql_error</function>.
<simplelist>
<member><function>mysql_fetch_row</function></member>
<member><function>mysql_fetch_array</function></member>
<member><function>mysql_data_seek</function></member>
<member><function>mysql_query</function></member>
<member><function>mysql_error</function></member>
</simplelist>
</para>
</refsect1>
</refentry>

View file

@ -1,31 +1,50 @@
<?xml version="1.0" encoding="iso-8859-1"?>
<!-- $Revision: 1.12 $ -->
<!-- splitted from ./en/functions/mysql.xml, last change in rev 1.2 -->
<!-- $Revision: 1.13 $ -->
<refentry id="function.mysql-fetch-field">
<refnamediv>
<refname>mysql_fetch_field</refname>
<refpurpose>
Get column information from a result and return as an object
</refpurpose>
<refpurpose>Get column information from a result and return as an object</refpurpose>
</refnamediv>
<refsect1>
<title>Description</title>
<refsect1 role="description">
&reftitle.description;
<methodsynopsis>
<type>object</type><methodname>mysql_fetch_field</methodname>
<methodparam><type>resource</type><parameter>result</parameter></methodparam>
<methodparam choice="opt"><type>int</type><parameter>field_offset</parameter></methodparam>
</methodsynopsis>
<para>
Returns an object containing field information.
Returns an object containing field information. This function can be used
to obtain information about fields in the provided query result.
</para>
</refsect1>
<refsect1 role="parameters">
&reftitle.parameters;
<para>
<variablelist>
&mysql.result.description;
<varlistentry>
<term><parameter>field_offset</parameter></term>
<listitem>
<para>
The numerical field offset. If the field offset is not specified, the
next field that was not yet retrieved by this function is retrieved.
The <parameter>field_offset</parameter> starts at <literal>0</literal>.
</para>
</listitem>
</varlistentry>
</variablelist>
</para>
</refsect1>
<refsect1 role="returnvalues">
&reftitle.returnvalues;
<para>
Returns an <type>object</type> containing field information. The properties
of the object are:
</para>
<para>
<function>mysql_fetch_field</function> can be used in order to
obtain information about fields in a certain query result. If
the field offset isn't specified, the next field that wasn't yet
retrieved by <function>mysql_fetch_field</function> is retrieved.
</para>
<para>
The properties of the object are:
<itemizedlist>
<listitem>
<simpara>
@ -89,7 +108,10 @@
</listitem>
</itemizedlist>
</para>
&database.field-case;
</refsect1>
<refsect1 role="examples">
&reftitle.examples;
<para>
<example>
<title><function>mysql_fetch_field</function> example</title>
@ -135,8 +157,19 @@ mysql_free_result($result);
</programlisting>
</example>
</para>
</refsect1>
<refsect1 role="notes">
&reftitle.notes;
&database.field-case;
</refsect1>
<refsect1 role="seealso">
&reftitle.seealso;
<para>
See also <function>mysql_field_seek</function>.
<simplelist>
<member><function>mysql_field_seek</function></member>
</simplelist>
</para>
</refsect1>
</refentry>

View file

@ -1,23 +1,20 @@
<?xml version="1.0" encoding="iso-8859-1"?>
<!-- $Revision: 1.8 $ -->
<!-- splitted from ./en/functions/mysql.xml, last change in rev 1.2 -->
<!-- $Revision: 1.9 $ -->
<refentry id="function.mysql-fetch-lengths">
<refnamediv>
<refname>mysql_fetch_lengths</refname>
<refpurpose>
Get the length of each output in a result
</refpurpose>
<refpurpose>Get the length of each output in a result</refpurpose>
</refnamediv>
<refsect1>
<title>Description</title>
<refsect1 role="description">
&reftitle.description;
<methodsynopsis>
<type>array</type><methodname>mysql_fetch_lengths</methodname>
<methodparam><type>resource</type><parameter>result</parameter></methodparam>
</methodsynopsis>
<para>
Returns an array that corresponds to the lengths of each field
in the last row fetched by <function>mysql_fetch_row</function>,
or &false; on error.
in the last row fetched by MySQL.
</para>
<para>
<function>mysql_fetch_lengths</function> stores the lengths of
@ -28,6 +25,26 @@
<function>mysql_fetch_object</function> in an array, starting at
offset 0.
</para>
</refsect1>
<refsect1 role="parameters">
&reftitle.parameters;
<para>
<variablelist>
&mysql.result.description;
</variablelist>
</para>
</refsect1>
<refsect1 role="returnvalues">
&reftitle.returnvalues;
<para>
An <type>array</type> of lengths on success, or &false; on failure.
</para>
</refsect1>
<refsect1 role="examples">
&reftitle.examples;
<para>
<example>
<title>A <function>mysql_fetch_lengths</function> example</title>
@ -64,10 +81,16 @@ Array
</screen>
</example>
</para>
</refsect1>
<refsect1 role="seealso">
&reftitle.seealso;
<para>
See also <function>mysql_field_len</function>,
<function>mysql_fetch_row</function>, and
<function>strlen</function>.
<simplelist>
<member><function>mysql_field_len</function></member>
<member><function>mysql_fetch_row</function></member>
<member><function>strlen</function></member>
</simplelist>
</para>
</refsect1>
</refentry>

View file

@ -1,54 +1,48 @@
<?xml version="1.0" encoding="iso-8859-1"?>
<!-- $Revision: 1.12 $ -->
<!-- splitted from ./en/functions/mysql.xml, last change in rev 1.2 -->
<!-- $Revision: 1.13 $ -->
<refentry id="function.mysql-fetch-object">
<refnamediv>
<refname>mysql_fetch_object</refname>
<refpurpose>Fetch a result row as an object</refpurpose>
</refnamediv>
<refsect1>
<title>Description</title>
<refsect1 role="description">
&reftitle.description;
<methodsynopsis>
<type>object</type><methodname>mysql_fetch_object</methodname>
<methodparam><type>resource</type><parameter>result</parameter></methodparam>
</methodsynopsis>
<para>
Returns an object with properties that correspond to the fetched
row, or &false; if there are no more rows.
Returns an object with properties that correspond to the fetched row.
</para>
</refsect1>
<refsect1 role="parameters">
&reftitle.parameters;
<para>
<variablelist>
&mysql.result.description;
</variablelist>
</para>
</refsect1>
<refsect1 role="returnvalues">
&reftitle.returnvalues;
<para>
Returns an <type>object</type> with properties that correspond to the
fetched row, or &false; if there are no more rows.
</para>
<para>
<function>mysql_fetch_object</function> is similar to
<function>mysql_fetch_array</function>, with one difference - an
object is returned, instead of an array. Indirectly, that means
that you can only access the data by the field names, and not by
their offsets (numbers are illegal property names).
<function>mysql_fetch_row</function> fetches one row of data from
the result associated with the specified result identifier. The
row is returned as an array. Each result column is stored in an
array offset, starting at offset 0.
</para>
&database.field-case;
&database.fetch-null;
</refsect1>
<refsect1 role="examples">
&reftitle.examples;
<para>
<example>
<title><function>mysql_fetch_object</function> example</title>
<programlisting role="php">
<![CDATA[
<?php
$row = mysql_fetch_object($result);
/* this is valid */
echo $row->field;
/* this is invalid */
// echo $row->0;
?>
]]>
</programlisting>
</example>
</para>
<para>
Speed-wise, the function is identical to
<function>mysql_fetch_array</function>, and almost as quick as
<function>mysql_fetch_row</function> (the difference is
insignificant).
<example>
<title><function>mysql_fetch_object</function> example</title>
<programlisting role="php">
@ -68,12 +62,60 @@ mysql_free_result($result);
</example>
</para>
<para>
See also
<function>mysql_fetch_array</function>,
<function>mysql_fetch_assoc</function>,
<function>mysql_fetch_row</function>,
<function>mysql_data_seek</function> and
<function>mysql_query</function>.
<example>
<title><function>mysql_fetch_object</function> example</title>
<programlisting role="php">
<![CDATA[
<?php
$row = mysql_fetch_object($result);
/* this is valid */
echo $row->field;
/* this is invalid */
// echo $row->0;
?>
]]>
</programlisting>
</example>
</para>
</refsect1>
<refsect1 role="notes">
&reftitle.notes;
<note>
<title>Performance</title>
<para>
Speed-wise, the function is identical to
<function>mysql_fetch_array</function>, and almost as quick as
<function>mysql_fetch_row</function> (the difference is
insignificant).
</para>
</note>
<note>
<para>
<function>mysql_fetch_object</function> is similar to
<function>mysql_fetch_array</function>, with one difference - an
object is returned, instead of an array. Indirectly, that means
that you can only access the data by the field names, and not by
their offsets (numbers are illegal property names).
</para>
</note>
&database.field-case;
&database.fetch-null;
</refsect1>
<refsect1 role="seealso">
&reftitle.seealso;
<para>
<simplelist>
<member><function>mysql_fetch_array</function></member>
<member><function>mysql_fetch_assoc</function></member>
<member><function>mysql_fetch_row</function></member>
<member><function>mysql_data_seek</function></member>
<member><function>mysql_query</function></member>
</simplelist>
</para>
</refsect1>
</refentry>

View file

@ -1,33 +1,47 @@
<?xml version="1.0" encoding="iso-8859-1"?>
<!-- $Revision: 1.10 $ -->
<!-- splitted from ./en/functions/mysql.xml, last change in rev 1.2 -->
<!-- $Revision: 1.11 $ -->
<refentry id="function.mysql-fetch-row">
<refnamediv>
<refname>mysql_fetch_row</refname>
<refpurpose>Get a result row as an enumerated array</refpurpose>
</refnamediv>
<refsect1>
<title>Description</title>
<refsect1 role="description">
&reftitle.description;
<methodsynopsis>
<type>array</type><methodname>mysql_fetch_row</methodname>
<methodparam><type>resource</type><parameter>result</parameter></methodparam>
</methodsynopsis>
<para>
Returns an array that corresponds to the fetched row, or &false;
if there are no more rows.
Returns a numerical array that corresponds to the fetched row.
</para>
</refsect1>
<refsect1 role="parameters">
&reftitle.parameters;
<para>
<variablelist>
&mysql.result.description;
</variablelist>
</para>
</refsect1>
<refsect1 role="returnvalues">
&reftitle.returnvalues;
<para>
Returns an numerical array that corresponds to the fetched row, or
&false; if there are no more rows.
</para>
&database.fetch-null;
<para>
<function>mysql_fetch_row</function> fetches one row of data from
the result associated with the specified result identifier. The
row is returned as an array. Each result column is stored in an
array offset, starting at offset 0.
</para>
<para>
Subsequent call to <function>mysql_fetch_row</function> would
return the next row in the result set, or &false; if there are no
more rows.
</para>
</refsect1>
<refsect1 role="examples">
&reftitle.examples;
<para>
<example>
<title>Fetching one row with <function>mysql_fetch_row</function></title>
@ -48,14 +62,24 @@ echo $row[1]; // the email value
</programlisting>
</example>
</para>
</refsect1>
<refsect1 role="notes">
&reftitle.notes;
&database.fetch-null;
</refsect1>
<refsect1 role="seealso">
&reftitle.seealso;
<para>
See also
<function>mysql_fetch_array</function>,
<function>mysql_fetch_assoc</function>,
<function>mysql_fetch_object</function>,
<function>mysql_data_seek</function>,
<function>mysql_fetch_lengths</function> and
<function>mysql_result</function>.
<simplelist>
<member><function>mysql_fetch_array</function></member>
<member><function>mysql_fetch_assoc</function></member>
<member><function>mysql_data_object</function></member>
<member><function>mysql_data_seek</function></member>
<member><function>mysql_fetch_lengths</function></member>
<member><function>mysql_result</function></member>
</simplelist>
</para>
</refsect1>
</refentry>

View file

@ -1,15 +1,13 @@
<?xml version="1.0" encoding="iso-8859-1"?>
<!-- $Revision: 1.8 $ -->
<!-- splitted from ./en/functions/mysql.xml, last change in rev 1.17 -->
<!-- $Revision: 1.9 $ -->
<refentry id="function.mysql-field-flags">
<refnamediv>
<refname>mysql_field_flags</refname>
<refpurpose>
Get the flags associated with the specified field in a result
</refpurpose>
<refpurpose>Get the flags associated with the specified field in a result</refpurpose>
</refnamediv>
<refsect1>
<title>Description</title>
<refsect1 role="description">
&reftitle.description;
<methodsynopsis>
<type>string</type><methodname>mysql_field_flags</methodname>
<methodparam><type>resource</type><parameter>result</parameter></methodparam>
@ -21,14 +19,36 @@
per flag separated by a single space, so that you can split the
returned value using <function>explode</function>.
</para>
<para>The following flags are reported, if your version of MySQL
</refsect1>
<refsect1 role="parameters">
&reftitle.parameters;
<para>
<variablelist>
&mysql.result.description;
&mysql.field-offset.req.description;
</variablelist>
</para>
</refsect1>
<refsect1 role="returnvalues">
&reftitle.returnvalues;
<para>
Returns a string of flags associated with the result, or &false; on failure.
</para>
<para>
The following flags are reported, if your version of MySQL
is current enough to support them: <literal>"not_null"</literal>,
<literal>"primary_key"</literal>, <literal>"unique_key"</literal>,
<literal>"multiple_key"</literal>, <literal>"blob"</literal>,
<literal>"unsigned"</literal>, <literal>"zerofill"</literal>,
<literal>"binary"</literal>, <literal>"enum"</literal>,
<literal>"auto_increment"</literal> et <literal>"timestamp"</literal>.
<literal>"auto_increment"</literal> and <literal>"timestamp"</literal>.
</para>
</refsect1>
<refsect1 role="examples">
&reftitle.examples;
<para>
<example>
<title>A <function>mysql_field_flags</function> example</title>
@ -61,10 +81,16 @@ Array
</screen>
</example>
</para>
<para>
For downward compatibility <function>mysql_fieldflags</function>
can also be used. This is deprecated, however.
</para>
</refsect1>
<refsect1 role="notes">
&reftitle.notes;
<note>
<para>
&info.deprecated.alias;
<function>mysql_fieldflags</function>
</para>
</note>
</refsect1>
</refentry>

View file

@ -1,15 +1,13 @@
<?xml version="1.0" encoding="iso-8859-1"?>
<!-- $Revision: 1.7 $ -->
<!-- splitted from ./en/functions/mysql.xml, last change in rev 1.17 -->
<!-- $Revision: 1.8 $ -->
<refentry id="function.mysql-field-len">
<refnamediv>
<refname>mysql_field_len</refname>
<refpurpose>
Returns the length of the specified field
</refpurpose>
<refpurpose>Returns the length of the specified field</refpurpose>
</refnamediv>
<refsect1>
<title>Description</title>
<refsect1 role="description">
&reftitle.description;
<methodsynopsis>
<type>int</type><methodname>mysql_field_len</methodname>
<methodparam><type>resource</type><parameter>result</parameter></methodparam>
@ -19,6 +17,27 @@
<function>mysql_field_len</function> returns the length of the
specified field.
</para>
</refsect1>
<refsect1 role="parameters">
&reftitle.parameters;
<para>
<variablelist>
&mysql.result.description;
&mysql.field-offset.req.description;
</variablelist>
</para>
</refsect1>
<refsect1 role="returnvalues">
&reftitle.returnvalues;
<para>
The name of the specified field index on success, or &false; on failure.
</para>
</refsect1>
<refsect1 role="examples">
&reftitle.examples;
<para>
<example>
<title><function>mysql_field_len</function> example</title>
@ -40,13 +59,25 @@ echo $length;
</programlisting>
</example>
</para>
</refsect1>
<refsect1 role="notes">
&reftitle.notes;
<note>
<para>
&info.deprecated.alias;
<function>mysql_fieldlen</function>
</para>
</note>
</refsect1>
<refsect1 role="seealso">
&reftitle.seealso;
<para>
For downward compatibility <function>mysql_fieldlen</function>
can also be used. This is deprecated, however.
</para>
<para>
See also <function>mysql_fetch_lengths</function> and
<function>strlen</function>.
<simplelist>
<member><function>mysql_fetch_lengths</function></member>
<member><function>strlen</function></member>
</simplelist>
</para>
</refsect1>
</refentry>

View file

@ -1,36 +1,43 @@
<?xml version="1.0" encoding="iso-8859-1"?>
<!-- $Revision: 1.12 $ -->
<!-- splitted from ./en/functions/mysql.xml, last change in rev 1.2 -->
<!-- $Revision: 1.13 $ -->
<refentry id="function.mysql-field-name">
<refnamediv>
<refname>mysql_field_name</refname>
<refpurpose>
Get the name of the specified field in a result
</refpurpose>
<refpurpose>Get the name of the specified field in a result</refpurpose>
</refnamediv>
<refsect1>
<title>Description</title>
<refsect1 role="description">
&reftitle.description;
<methodsynopsis>
<type>string</type><methodname>mysql_field_name</methodname>
<methodparam><type>resource</type><parameter>result</parameter></methodparam>
<methodparam><type>int</type><parameter>field_index</parameter></methodparam>
<methodparam><type>int</type><parameter>field_offset</parameter></methodparam>
</methodsynopsis>
<para>
<function>mysql_field_name</function> returns the name of the
specified field index. <parameter>result</parameter> must be a
valid result identifier and <parameter>field_index</parameter> is
the numerical offset of the field.
specified field index.
</para>
<note>
<para>
<parameter>field_index</parameter> starts at 0.
</para>
<para>
e.g. The index of the third field would actually be 2, the index
of the fourth field would be 3 and so on.
</para>
</note>
&database.field-case;
</refsect1>
<refsect1 role="parameters">
&reftitle.parameters;
<para>
<variablelist>
&mysql.result.description;
&mysql.field-offset.req.description;
</variablelist>
</para>
</refsect1>
<refsect1 role="returnvalues">
&reftitle.returnvalues;
<para>
The name of the specified field index on success, or &false; on failure.
</para>
</refsect1>
<refsect1 role="examples">
&reftitle.examples;
<para>
<example>
<title><function>mysql_field_name</function> example</title>
@ -58,9 +65,7 @@ echo mysql_field_name($res, 2);
?>
]]>
</programlisting>
<para>
The above example would produce the following output:
</para>
&example.outputs;
<screen>
<![CDATA[
user_id
@ -69,10 +74,17 @@ password
</screen>
</example>
</para>
<para>
For downwards compatibility <function>mysql_fieldname</function>
can also be used. This is deprecated, however.
</para>
</refsect1>
<refsect1 role="notes">
&reftitle.notes;
&database.field-case;
<note>
<para>
&info.deprecated.alias;
<function>mysql_fieldname</function>
</para>
</note>
</refsect1>
</refentry>

View file

@ -1,15 +1,13 @@
<?xml version="1.0" encoding="iso-8859-1"?>
<!-- $Revision: 1.5 $ -->
<!-- splitted from ./en/functions/mysql.xml, last change in rev 1.2 -->
<!-- $Revision: 1.6 $ -->
<refentry id="function.mysql-field-seek">
<refnamediv>
<refname>mysql_field_seek</refname>
<refpurpose>
Set result pointer to a specified field offset
</refpurpose>
<refpurpose>Set result pointer to a specified field offset</refpurpose>
</refnamediv>
<refsect1>
<title>Description</title>
<refsect1 role="description">
&reftitle.description;
<methodsynopsis>
<type>int</type><methodname>mysql_field_seek</methodname>
<methodparam><type>resource</type><parameter>result</parameter></methodparam>
@ -21,8 +19,24 @@
offset, the field offset specified in
<function>mysql_field_seek</function> will be returned.
</para>
</refsect1>
<refsect1 role="parameters">
&reftitle.parameters;
<para>
See also <function>mysql_fetch_field</function>.
<variablelist>
&mysql.result.description;
&mysql.field-offset.req.description;
</variablelist>
</para>
</refsect1>
<refsect1 role="seealso">
&reftitle.seealso;
<para>
<simplelist>
<member><function>mysql_fetch_field</function></member>
</simplelist>
</para>
</refsect1>
</refentry>

View file

@ -1,24 +1,42 @@
<?xml version="1.0" encoding="iso-8859-1"?>
<!-- $Revision: 1.6 $ -->
<!-- splitted from ./en/functions/mysql.xml, last change in rev 1.2 -->
<!-- $Revision: 1.7 $ -->
<refentry id="function.mysql-field-table">
<refnamediv>
<refname>mysql_field_table</refname>
<refpurpose>
Get name of the table the specified field is in
</refpurpose>
<refpurpose>Get name of the table the specified field is in</refpurpose>
</refnamediv>
<refsect1>
<title>Description</title>
<refsect1 role="description">
&reftitle.description;
<methodsynopsis>
<type>string</type><methodname>mysql_field_table</methodname>
<methodparam><type>resource</type><parameter>result</parameter></methodparam>
<methodparam><type>int</type><parameter>field_offset</parameter></methodparam>
</methodsynopsis>
<para>
Returns the name of the table that the specified field is
in.
Returns the name of the table that the specified field is in.
</para>
</refsect1>
<refsect1 role="parameters">
&reftitle.parameters;
<para>
<variablelist>
&mysql.result.description;
&mysql.field-offset.req.description;
</variablelist>
</para>
</refsect1>
<refsect1 role="returnvalues">
&reftitle.returnvalues;
<para>
The name of the table on success.
</para>
</refsect1>
<refsect1 role="examples">
&reftitle.examples;
<para>
<example>
<title>A <function>mysql_field_table</function> example</title>
@ -39,12 +57,24 @@ echo $table; // people
</programlisting>
</example>
</para>
</refsect1>
<refsect1 role="notes">
&reftitle.notes;
<note>
<para>
&info.deprecated.alias;
<function>mysql_fieldtable</function>
</para>
</note>
</refsect1>
<refsect1 role="seealso">
&reftitle.seealso;
<para>
For downward compatibility <function>mysql_fieldtable</function>
can also be used. This is deprecated, however.
</para>
<para>
See also <function>mysql_list_tables</function>.
<simplelist>
<member><function>mysql_list_tables</function></member>
</simplelist>
</para>
</refsect1>
</refentry>

View file

@ -1,15 +1,13 @@
<?xml version="1.0" encoding="iso-8859-1"?>
<!-- $Revision: 1.11 $ -->
<!-- splitted from ./en/functions/mysql.xml, last change in rev 1.2 -->
<!-- $Revision: 1.12 $ -->
<refentry id="function.mysql-field-type">
<refnamediv>
<refname>mysql_field_type</refname>
<refpurpose>
Get the type of the specified field in a result
</refpurpose>
<refpurpose>Get the type of the specified field in a result</refpurpose>
</refnamediv>
<refsect1>
<title>Description</title>
<refsect1 role="description">
&reftitle.description;
<methodsynopsis>
<type>string</type><methodname>mysql_field_type</methodname>
<methodparam><type>resource</type><parameter>result</parameter></methodparam>
@ -18,11 +16,34 @@
<para>
<function>mysql_field_type</function> is similar to the
<function>mysql_field_name</function> function. The arguments are
identical, but the field type is returned instead. The field type
identical, but the field type is returned instead.
</para>
</refsect1>
<refsect1 role="parameters">
&reftitle.parameters;
<para>
<variablelist>
&mysql.result.description;
&mysql.field-offset.req.description;
</variablelist>
</para>
</refsect1>
<refsect1 role="returnvalues">
&reftitle.returnvalues;
<para>
The returned field type
will be one of <literal>"int"</literal>, <literal>"real"</literal>,
<literal>"string"</literal>, <literal>"blob"</literal>, and others as
detailed in the <ulink url="&url.mysql.docs;">MySQL
documentation</ulink>.
</para>
</refsect1>
<refsect1 role="examples">
&reftitle.examples;
<para>
<example>
<title><function>mysql_field_type</function> example</title>
<programlisting role="php">
@ -48,9 +69,7 @@ mysql_close();
?>
]]>
</programlisting>
<para>
The above example would produce the following output:
</para>
&example.outputs.similar;
<screen>
<![CDATA[
Your 'func' table has 4 fields and 1 record(s)
@ -63,10 +82,16 @@ string type 9 not_null enum
</screen>
</example>
</para>
<para>
For downward compatibility <function>mysql_fieldtype</function>
can also be used. This is deprecated, however.
</para>
</refsect1>
<refsect1 role="notes">
&reftitle.notes;
<note>
<para>
&info.deprecated.alias;
<function>mysql_fieldtype</function>
</para>
</note>
</refsect1>
</refentry>

View file

@ -1,13 +1,13 @@
<?xml version="1.0" encoding="iso-8859-1"?>
<!-- $Revision: 1.7 $ -->
<!-- splitted from ./en/functions/mysql.xml, last change in rev 1.102 -->
<!-- $Revision: 1.8 $ -->
<refentry id="function.mysql-free-result">
<refnamediv>
<refname>mysql_free_result</refname>
<refpurpose>Free result memory</refpurpose>
</refnamediv>
<refsect1>
<title>Description</title>
<refsect1 role="description">
&reftitle.description;
<methodsynopsis>
<type>bool</type><methodname>mysql_free_result</methodname>
<methodparam><type>resource</type><parameter>result</parameter></methodparam>
@ -22,6 +22,19 @@
that return large result sets. All associated result memory is
automatically freed at the end of the script's execution.
</para>
</refsect1>
<refsect1 role="parameters">
&reftitle.parameters;
<para>
<variablelist>
&mysql.result.description;
</variablelist>
</para>
</refsect1>
<refsect1 role="returnvalues">
&reftitle.returnvalues;
<para>
&return.success;
</para>
@ -31,6 +44,10 @@
<function>mysql_query</function> only returns a <type>resource</type>
for SELECT, SHOW, EXPLAIN, and DESCRIBE queries.
</para>
</refsect1>
<refsect1 role="examples">
&reftitle.examples;
<para>
<example>
<title>A <function>mysql_free_result</function> example</title>
@ -55,13 +72,25 @@ echo $row['email'];
</programlisting>
</example>
</para>
</refsect1>
<refsect1 role="notes">
&reftitle.notes;
<note>
<para>
&info.deprecated.alias;
<function>mysql_freeresult</function>
</para>
</note>
</refsect1>
<refsect1 role="seealso">
&reftitle.seealso;
<para>
For downward compatibility <function>mysql_freeresult</function>
can also be used. This is deprecated, however.
</para>
<para>
See also <function>mysql_query</function> and
<function>is_resource</function>.
<simplelist>
<member><function>mysql_query</function></member>
<member><function>is_resource</function></member>
</simplelist>
</para>
</refsect1>
</refentry>

View file

@ -1,13 +1,13 @@
<?xml version="1.0" encoding="iso-8859-1"?>
<!-- $Revision: 1.8 $ -->
<!-- splitted from ./en/functions/mysql.xml, last change in rev 1.62 -->
<!-- $Revision: 1.9 $ -->
<refentry id="function.mysql-get-client-info">
<refnamediv>
<refname>mysql_get_client_info</refname>
<refpurpose>Get MySQL client info</refpurpose>
</refnamediv>
<refsect1>
<title>Description</title>
<refsect1 role="description">
&reftitle.description;
<methodsynopsis>
<type>string</type><methodname>mysql_get_client_info</methodname>
<void/>
@ -16,6 +16,17 @@
<function>mysql_get_client_info</function> returns a string that
represents the client library version.
</para>
</refsect1>
<refsect1 role="returnvalues">
&reftitle.returnvalues;
<para>
The MySQL client version.
</para>
</refsect1>
<refsect1 role="examples">
&reftitle.examples;
<para>
<example>
<title><function>mysql_get_client_info</function> example</title>
@ -26,9 +37,7 @@ printf("MySQL client info: %s\n", mysql_get_client_info());
?>
]]>
</programlisting>
<para>
The above example would produce the following output:
</para>
&example.outputs.similar;
<screen>
<![CDATA[
MySQL client info: 3.23.39
@ -36,11 +45,16 @@ MySQL client info: 3.23.39
</screen>
</example>
</para>
</refsect1>
<refsect1 role="seealso">
&reftitle.seealso;
<para>
See also
<function>mysql_get_host_info</function>,
<function>mysql_get_proto_info</function> and
<function>mysql_get_server_info</function>.
<simplelist>
<member><function>mysql_get_host_info</function></member>
<member><function>mysql_get_proto_info</function></member>
<member><function>mysql_get_server_info</function></member>
</simplelist>
</para>
</refsect1>
</refentry>

View file

@ -1,24 +1,42 @@
<?xml version="1.0" encoding="iso-8859-1"?>
<!-- $Revision: 1.11 $ -->
<!-- splitted from ./en/functions/mysql.xml, last change in rev 1.62 -->
<!-- $Revision: 1.12 $ -->
<refentry id="function.mysql-get-host-info">
<refnamediv>
<refname>mysql_get_host_info</refname>
<refpurpose>Get MySQL host info</refpurpose>
</refnamediv>
<refsect1>
<title>Description</title>
<refsect1 role="description">
&reftitle.description;
<methodsynopsis>
<type>string</type><methodname>mysql_get_host_info</methodname>
<methodparam choice="opt"><type>resource</type><parameter>link_identifier</parameter></methodparam>
</methodsynopsis>
<para>
<function>mysql_get_host_info</function> returns a string
describing the type of connection in use for the connection
<parameter>link_identifier</parameter>, including the server host
name. If <parameter>link_identifier</parameter> is omitted, the
last opened connection will be used.
Describes the type of connection in use for the connection, including the
server host name.
</para>
</refsect1>
<refsect1 role="parameters">
&reftitle.parameters;
<para>
<variablelist>
&mysql.linkid.description;
</variablelist>
</para>
</refsect1>
<refsect1 role="returnvalues">
&reftitle.returnvalues;
<para>
Returns a string describing the type of MySQL connection in use for the
connection or &false; on failure.
</para>
</refsect1>
<refsect1 role="examples">
&reftitle.examples;
<para>
<example>
<title><function>mysql_get_host_info</function> example</title>
@ -33,9 +51,7 @@ printf("MySQL host info: %s\n", mysql_get_host_info());
?>
]]>
</programlisting>
<para>
The above example would produce the following output:
</para>
&example.outputs.similar;
<screen>
<![CDATA[
MySQL host info: Localhost via UNIX socket
@ -43,11 +59,16 @@ MySQL host info: Localhost via UNIX socket
</screen>
</example>
</para>
</refsect1>
<refsect1 role="seealso">
&reftitle.seealso;
<para>
See also
<function>mysql_get_client_info</function>,
<function>mysql_get_proto_info</function> and
<function>mysql_get_server_info</function>.
<simplelist>
<member><function>mysql_get_client_info</function></member>
<member><function>mysql_get_proto_info</function></member>
<member><function>mysql_get_server_info</function></member>
</simplelist>
</para>
</refsect1>
</refentry>

View file

@ -1,24 +1,40 @@
<?xml version="1.0" encoding="iso-8859-1"?>
<!-- $Revision: 1.12 $ -->
<!-- splitted from ./en/functions/mysql.xml, last change in rev 1.62 -->
<!-- $Revision: 1.13 $ -->
<refentry id="function.mysql-get-proto-info">
<refnamediv>
<refname>mysql_get_proto_info</refname>
<refpurpose>Get MySQL protocol info</refpurpose>
</refnamediv>
<refsect1>
<title>Description</title>
<refsect1 role="description">
&reftitle.description;
<methodsynopsis>
<type>int</type><methodname>mysql_get_proto_info</methodname>
<methodparam choice="opt"><type>resource</type><parameter>link_identifier</parameter></methodparam>
</methodsynopsis>
<para>
<function>mysql_get_proto_info</function> returns the protocol
version used by connection
<parameter>link_identifier</parameter>. If
<parameter>link_identifier</parameter> is omitted, the last opened
connection will be used.
Retrieves the MySQL protocol.
</para>
</refsect1>
<refsect1 role="parameters">
&reftitle.parameters;
<para>
<variablelist>
&mysql.linkid.description;
</variablelist>
</para>
</refsect1>
<refsect1 role="returnvalues">
&reftitle.returnvalues;
<para>
Returns the MySQL protocol on success, or &false; on failure.
</para>
</refsect1>
<refsect1 role="examples">
&reftitle.examples;
<para>
<example>
<title><function>mysql_get_proto_info</function> example</title>
@ -33,9 +49,7 @@ printf("MySQL protocol version: %s\n", mysql_get_proto_info());
?>
]]>
</programlisting>
<para>
The above example would produce the following output:
</para>
&example.outputs.similar;
<screen>
<![CDATA[
MySQL protocol version: 10
@ -43,11 +57,16 @@ MySQL protocol version: 10
</screen>
</example>
</para>
</refsect1>
<refsect1 role="seealso">
&reftitle.seealso;
<para>
See also
<function>mysql_get_client_info</function>,
<function>mysql_get_host_info</function> and
<function>mysql_get_server_info</function>.
<simplelist>
<member><function>mysql_get_client_info</function></member>
<member><function>mysql_get_host_info</function></member>
<member><function>mysql_get_server_info</function></member>
</simplelist>
</para>
</refsect1>
</refentry>

View file

@ -1,24 +1,40 @@
<?xml version="1.0" encoding="iso-8859-1"?>
<!-- $Revision: 1.12 $ -->
<!-- splitted from ./en/functions/mysql.xml, last change in rev 1.96 -->
<!-- $Revision: 1.13 $ -->
<refentry id="function.mysql-get-server-info">
<refnamediv>
<refname>mysql_get_server_info</refname>
<refpurpose>Get MySQL server info</refpurpose>
</refnamediv>
<refsect1>
<title>Description</title>
<refsect1 role="description">
&reftitle.description;
<methodsynopsis>
<type>string</type><methodname>mysql_get_server_info</methodname>
<methodparam choice="opt"><type>resource</type><parameter>link_identifier</parameter></methodparam>
</methodsynopsis>
<para>
<function>mysql_get_server_info</function> returns the server
version used by connection
<parameter>link_identifier</parameter>. If
<parameter>link_identifier</parameter> is omitted, the last opened
connection will be used.
Retrieves the MySQL server version.
</para>
</refsect1>
<refsect1 role="parameters">
&reftitle.parameters;
<para>
<variablelist>
&mysql.linkid.description;
</variablelist>
</para>
</refsect1>
<refsect1 role="returnvalues">
&reftitle.returnvalues;
<para>
Returns the MySQL server version on success, or &false; on failure.
</para>
</refsect1>
<refsect1 role="examples">
&reftitle.examples;
<para>
<example>
<title><function>mysql_get_server_info</function> example</title>
@ -33,9 +49,7 @@ printf("MySQL server version: %s\n", mysql_get_server_info());
?>
]]>
</programlisting>
<para>
The above example would produce the following output:
</para>
&example.outputs.similar;
<screen>
<![CDATA[
MySQL server version: 4.0.1-alpha
@ -43,12 +57,17 @@ MySQL server version: 4.0.1-alpha
</screen>
</example>
</para>
</refsect1>
<refsect1 role="seealso">
&reftitle.seealso;
<para>
See also
<function>mysql_get_client_info</function>,
<function>mysql_get_host_info</function>,
<function>mysql_get_proto_info</function>, and
<function>phpversion</function>.
<simplelist>
<member><function>mysql_get_client_info</function></member>
<member><function>mysql_get_host_info</function></member>
<member><function>mysql_get_proto_info</function></member>
<member><function>phpversion</function></member>
</simplelist>
</para>
</refsect1>
</refentry>

View file

@ -1,31 +1,50 @@
<?xml version="1.0" encoding="iso-8859-1"?>
<!-- $Revision: 1.8 $ -->
<!-- splitted from ./en/functions/mysql.xml, last change in rev 1.2 -->
<!-- $Revision: 1.9 $ -->
<refentry id="function.mysql-info">
<refnamediv>
<refname>mysql_info</refname>
<refpurpose>
Get information about the most recent query
</refpurpose>
<refpurpose>Get information about the most recent query</refpurpose>
</refnamediv>
<refsect1>
<title>Description</title>
<refsect1 role="description">
&reftitle.description;
<methodsynopsis>
<type>string</type><methodname>mysql_info</methodname>
<methodparam choice="opt"><type>resource</type><parameter>link_identifier</parameter></methodparam>
</methodsynopsis>
<para>
<function>mysql_info</function> returns detailed information about
the last query using the given <parameter>link_identifier</parameter>.
If <parameter>link_identifier</parameter> isn't specified, the last
opened link is assumed.
Returns detailed information about the last query.
</para>
</refsect1>
<refsect1 role="parameters">
&reftitle.parameters;
<para>
<variablelist>
&mysql.linkid.description;
</variablelist>
</para>
</refsect1>
<refsect1 role="returnvalues">
&reftitle.returnvalues;
<para>
Returns information about the statement on success, or &false; on
failure. See the example below for which statements provide information,
and what the returned value may look like. Statements that aren't listed
will return &false;
</para>
</refsect1>
<refsect1 role="examples">
&reftitle.examples;
<para>
<function>mysql_info</function> returns a string for all statements
listed below. For everything else, it returns &false;. The string
format depends on the given statement.
<example>
<title>Relevant MySQL Statements</title>
<para>
Statements that return string values. The numbers are only for
illustrating purpose; their values will correspond to the query.
</para>
<programlisting role="mysql">
<![CDATA[
INSERT INTO ... SELECT ...
@ -40,22 +59,29 @@ UPDATE
String format: Rows matched: 65 Changed: 65 Warnings: 0
]]>
</programlisting>
</example>
The numbers are only for illustrating purpose; their values will
correspond to the query.
</example>
</para>
</refsect1>
<refsect1 role="notes">
&reftitle.notes;
<note>
<para>
<function>mysql_info</function> returns a non-&false; value for the
INSERT ... VALUES statement only if multiple value lists are
specified in the statement.
</para>
</para>
</note>
</refsect1>
<refsect1 role="seealso">
&reftitle.seealso;
<para>
See also
<function>mysql_affected_rows</function>,
<function>mysql_insert_id</function>, and
<function>mysql_stat</function>.
<simplelist>
<member><function>mysql_affected_rows</function></member>
<member><function>mysql_insert_id</function></member>
<member><function>mysql_stat</function></member>
</simplelist>
</para>
</refsect1>
</refentry>

View file

@ -1,53 +1,44 @@
<?xml version="1.0" encoding="iso-8859-1"?>
<!-- $Revision: 1.13 $ -->
<!-- splitted from ./en/functions/mysql.xml, last change in rev 1.2 -->
<!-- $Revision: 1.14 $ -->
<refentry id="function.mysql-insert-id">
<refnamediv>
<refname>mysql_insert_id</refname>
<refpurpose>
Get the ID generated from the previous INSERT operation
</refpurpose>
<refpurpose>Get the ID generated from the previous INSERT operation</refpurpose>
</refnamediv>
<refsect1>
<title>Description</title>
<refsect1 role="description">
&reftitle.description;
<methodsynopsis>
<type>int</type><methodname>mysql_insert_id</methodname>
<methodparam choice="opt"><type>resource</type><parameter>link_identifier</parameter></methodparam>
</methodsynopsis>
<para>
<function>mysql_insert_id</function> returns the ID generated for
an AUTO_INCREMENT column by the previous INSERT query using the
given <parameter>link_identifier</parameter>. If
<parameter>link_identifier</parameter> isn't specified, the last
opened link is assumed.
Retrieves the ID generated for an AUTO_INCREMENT column by the previous
INSERT query.
</para>
</refsect1>
<refsect1 role="parameters">
&reftitle.parameters;
<para>
<function>mysql_insert_id</function> returns 0 if the previous
query does not generate an AUTO_INCREMENT value. If you need to
save the value for later, be sure to call
<function>mysql_insert_id</function> immediately after the
query that generates the value.
<variablelist>
&mysql.linkid.description;
</variablelist>
</para>
<note>
<para>
The value of the MySQL SQL function
<literal>LAST_INSERT_ID()</literal> always contains the most
recently generated AUTO_INCREMENT value, and is not reset
between queries.
</refsect1>
<refsect1 role="returnvalues">
&reftitle.returnvalues;
<para>
The ID generated for an AUTO_INCREMENT column by the previous
INSERT query on success, <literal>0</literal> if the previous
query does not generate an AUTO_INCREMENT value, or &false; if
no MySQL connection was established.
</para>
</note>
<warning>
<para>
<function>mysql_insert_id</function> converts the return type of
the native MySQL C API function
<literal>mysql_insert_id()</literal> to a type of
<literal>long</literal> (named <type>int</type> in PHP).
If your AUTO_INCREMENT column has a column type of BIGINT,
the value returned by <function>mysql_insert_id</function>
will be incorrect. Instead, use the internal MySQL SQL function
<literal>LAST_INSERT_ID()</literal> in an SQL query.
</para>
</warning>
</refsect1>
<refsect1 role="examples">
&reftitle.examples;
<para>
<example>
<title><function>mysql_insert_id</function> example</title>
@ -67,10 +58,46 @@ printf("Last inserted record has id %d\n", mysql_insert_id());
</programlisting>
</example>
</para>
</refsect1>
<refsect1 role="notes">
&reftitle.notes;
<caution>
<para>
<function>mysql_insert_id</function> converts the return type of
the native MySQL C API function
<literal>mysql_insert_id()</literal> to a type of
<literal>long</literal> (named <type>int</type> in PHP).
If your AUTO_INCREMENT column has a column type of BIGINT,
the value returned by <function>mysql_insert_id</function>
will be incorrect. Instead, use the internal MySQL SQL function
<literal>LAST_INSERT_ID()</literal> in an SQL query.
</para>
</caution>
<note>
<para>
Because <function>mysql_insert_id</function> acts on the last performed
query, be sure to call <function>mysql_insert_id</function> immediately
after the query that generates the value.
</para>
</note>
<note>
<para>
The value of the MySQL SQL function
<literal>LAST_INSERT_ID()</literal> always contains the most
recently generated AUTO_INCREMENT value, and is not reset
between queries.
</para>
</note>
</refsect1>
<refsect1 role="seealso">
&reftitle.seealso;
<para>
See also
<function>mysql_query</function> and
<function>mysql_info</function>.
<simplelist>
<member><function>mysql_query</function></member>
<member><function>mysql_info</function></member>
</simplelist>
</para>
</refsect1>
</refentry>

View file

@ -1,26 +1,44 @@
<?xml version="1.0" encoding="iso-8859-1"?>
<!-- $Revision: 1.8 $ -->
<!-- splitted from ./en/functions/mysql.xml, last change in rev 1.16 -->
<!-- $Revision: 1.9 $ -->
<refentry id="function.mysql-list-dbs">
<refnamediv>
<refname>mysql_list_dbs</refname>
<refpurpose>
List databases available on a MySQL server
</refpurpose>
<refpurpose>List databases available on a MySQL server</refpurpose>
</refnamediv>
<refsect1>
<title>Description</title>
<refsect1 role="description">
&reftitle.description;
<methodsynopsis>
<type>resource</type><methodname>mysql_list_dbs</methodname>
<methodparam choice="opt"><type>resource</type><parameter>link_identifier</parameter></methodparam>
</methodsynopsis>
<para>
<function>mysql_list_dbs</function> will return a result pointer
containing the databases available from the current mysql
daemon. Use the <function>mysql_tablename</function> function to
traverse this result pointer, or any function for result tables,
such as <function>mysql_fetch_array</function>.
Returns a result pointer containing the databases available from the
current mysql daemon.
</para>
</refsect1>
<refsect1 role="parameters">
&reftitle.parameters;
<para>
<variablelist>
&mysql.linkid.description;
</variablelist>
</para>
</refsect1>
<refsect1 role="returnvalues">
&reftitle.returnvalues;
<para>
Returns a result pointer <type>resource</type> on success, or &false; on
failure. Use the <function>mysql_tablename</function> function to traverse
this result pointer, or any function for result tables, such as
<function>mysql_fetch_array</function>.
</para>
</refsect1>
<refsect1 role="examples">
&reftitle.examples;
<para>
<example>
<title><function>mysql_list_dbs</function> example</title>
@ -36,33 +54,35 @@ while ($row = mysql_fetch_object($db_list)) {
?>
]]>
</programlisting>
<para>
The above example would produce the following output:
</para>
&example.outputs.similar;
<screen>
<![CDATA[
database1
database2
database3
...
]]>
</screen>
</example>
</para>
</refsect1>
<refsect1 role="notes">
&reftitle.notes;
<note>
<para>
The above code would just as easily work with
<function>mysql_fetch_row</function> or other similar functions.
&info.deprecated.alias;
<function>mysql_listdbs</function>
</para>
</note>
</refsect1>
<refsect1 role="seealso">
&reftitle.seealso;
<para>
For downward compatibility <function>mysql_listdbs</function> can
also be used. This is deprecated however.
</para>
<para>
See also
<function>mysql_db_name</function>, and
<function>mysql_select_db</function>.
<simplelist>
<member><function>mysql_db_name</function></member>
<member><function>mysql_select_db</function></member>
</simplelist>
</para>
</refsect1>
</refentry>

View file

@ -1,35 +1,70 @@
<?xml version="1.0" encoding="iso-8859-1"?>
<!-- $Revision: 1.10 $ -->
<!-- splitted from ./en/functions/mysql.xml, last change in rev 1.2 -->
<!-- $Revision: 1.11 $ -->
<refentry id="function.mysql-list-fields">
<refnamediv>
<refname>mysql_list_fields</refname>
<refpurpose>List MySQL table fields</refpurpose>
</refnamediv>
<refsect1>
<title>Description</title>
<refsect1 role="description">
&reftitle.description;
<methodsynopsis>
<type>resource</type><methodname>mysql_list_fields</methodname>
<methodparam><type>string</type><parameter>database_name</parameter></methodparam>
<methodparam><type>string</type><parameter>table_name</parameter></methodparam>
<methodparam choice="opt"><type>resource</type><parameter>link_identifier</parameter></methodparam>
</methodsynopsis>
<note>
<para>
The function <function>mysql_list_fields</function> is deprecated. It
is preferable to use <function>mysql_query</function> to issue a
SQL <literal>SHOW COLUMNS FROM table [LIKE 'name']</literal> Statement instead.
</para>
</note>
<para>
<function>mysql_list_fields</function> retrieves information
about the given table name. Arguments are the database and
the table name. A result pointer is returned which can be used
with <function>mysql_field_flags</function>,
Retrieves information about the given table name.
</para>
<para>
This function is deprecated. It is preferable to use
<function>mysql_query</function> to issue a SQL <literal>SHOW COLUMNS FROM
table [LIKE 'name']</literal> statement instead.
</para>
</refsect1>
<refsect1 role="parameters">
&reftitle.parameters;
<para>
<variablelist>
<varlistentry>
<term><parameter>database_name</parameter></term>
<listitem>
<para>
The name of the database that's being queried.
</para>
</listitem>
</varlistentry>
<varlistentry>
<term><parameter>table_name</parameter></term>
<listitem>
<para>
The name of the table that's being queried.
</para>
</listitem>
</varlistentry>
&mysql.linkid.description;
</variablelist>
</para>
</refsect1>
<refsect1 role="returnvalues">
&reftitle.returnvalues;
<para>
A result pointer <type>resource</type> on success, or &false; on
failure.
</para>
<para>
The returned result can be used with <function>mysql_field_flags</function>,
<function>mysql_field_len</function>,
<function>mysql_field_name</function>, and
<function>mysql_field_name</function>&listendand;
<function>mysql_field_type</function>.
</para>
</refsect1>
<refsect1 role="examples">
&reftitle.examples;
<para>
<example>
<title>Alternate to deprecated <function>mysql_list_fields</function></title>
@ -49,9 +84,7 @@ if (mysql_num_rows($result) > 0) {
?>
]]>
</programlisting>
<para>
The above example would produce output similar to:
</para>
&example.outputs.similar;
<screen>
<![CDATA[
Array
@ -76,14 +109,25 @@ Array
</screen>
</example>
</para>
</refsect1>
<refsect1 role="notes">
&reftitle.notes;
<note>
<para>
&info.deprecated.alias;
<function>mysql_listfields</function>
</para>
</note>
</refsect1>
<refsect1 role="seealso">
&reftitle.seealso;
<para>
For downward compatibility <function>mysql_listfields</function>
can also be used. This is deprecated however.
</para>
<para>
See also
<function>mysql_field_flags</function> and
<function>mysql_info</function>.
<simplelist>
<member><function>mysql_field_flags</function></member>
<member><function>mysql_info</function></member>
</simplelist>
</para>
</refsect1>
</refentry>

View file

@ -1,21 +1,40 @@
<?xml version="1.0" encoding="iso-8859-1"?>
<!-- $Revision: 1.8 $ -->
<!-- splitted from ./en/functions/mysql.xml, last change in rev 1.96 -->
<!-- $Revision: 1.9 $ -->
<refentry id="function.mysql-list-processes">
<refnamediv>
<refname>mysql_list_processes</refname>
<refpurpose>List MySQL processes</refpurpose>
</refnamediv>
<refsect1>
<title>Description</title>
<refsect1 role="description">
&reftitle.description;
<methodsynopsis>
<type>resource</type><methodname>mysql_list_processes</methodname>
<methodparam choice="opt"><type>resource</type><parameter>link_identifier</parameter></methodparam>
</methodsynopsis>
<para>
<function>mysql_list_processes</function> returns a result pointer
describing the current server threads.
Retrieves the current MySQL server threads.
</para>
</refsect1>
<refsect1 role="parameters">
&reftitle.parameters;
<para>
<variablelist>
&mysql.linkid.description;
</variablelist>
</para>
</refsect1>
<refsect1 role="returnvalues">
&reftitle.returnvalues;
<para>
A result pointer <type>resource</type> on success, or &false; on failure.
</para>
</refsect1>
<refsect1 role="examples">
&reftitle.examples;
<para>
<example>
<title><function>mysql_list_processes</function> example</title>
@ -33,9 +52,7 @@ mysql_free_result($result);
?>
]]>
</programlisting>
<para>
The above example would produce the following output:
</para>
&example.outputs.similar;
<screen>
<![CDATA[
1 localhost test Processlist 0
@ -44,10 +61,15 @@ mysql_free_result($result);
</screen>
</example>
</para>
</refsect1>
<refsect1 role="seealso">
&reftitle.seealso;
<para>
See also
<function>mysql_thread_id</function> and
<function>mysql_stat</function>.
<simplelist>
<member><function>mysql_thread_id</function></member>
<member><function>mysql_stat</function></member>
</simplelist>
</para>
</refsect1>
</refentry>

View file

@ -1,43 +1,59 @@
<?xml version="1.0" encoding="iso-8859-1"?>
<!-- $Revision: 1.15 $ -->
<!-- splitted from ./en/functions/mysql.xml, last change in rev 1.2 -->
<!-- $Revision: 1.16 $ -->
<refentry id="function.mysql-list-tables">
<refnamediv>
<refname>mysql_list_tables</refname>
<refpurpose>List tables in a MySQL database</refpurpose>
</refnamediv>
<refsect1>
<title>Description</title>
<refsect1 role="description">
&reftitle.description;
<methodsynopsis>
<type>resource</type><methodname>mysql_list_tables</methodname>
<methodparam><type>string</type><parameter>database</parameter></methodparam>
<methodparam choice="opt"><type>resource</type><parameter>link_identifier</parameter></methodparam>
</methodsynopsis>
<para>
<function>mysql_list_tables</function> takes a database name and
returns a result pointer much like the
<function>mysql_query</function> function.
Retrieves a list of table names from a MySQL database.
</para>
<para>
This function deprecated. It is preferable to use
<function>mysql_query</function> to issue a SQL <literal>SHOW TABLES
[FROM db_name] [LIKE 'pattern']</literal> statement instead.
</para>
</refsect1>
<refsect1 role="parameters">
&reftitle.parameters;
<para>
<variablelist>
<varlistentry>
<term><parameter>database</parameter></term>
<listitem>
<para>
The name of the database
</para>
</listitem>
</varlistentry>
&mysql.linkid.description;
</variablelist>
</para>
</refsect1>
<refsect1 role="returnvalues">
&reftitle.returnvalues;
<para>
A result pointer <type>resource</type> on success, or &false; on failure.
</para>
<para>
Use the <function>mysql_tablename</function> function to
traverse this result pointer, or any function for result tables,
such as <function>mysql_fetch_array</function>.
</para>
<para>
The <parameter>database</parameter> parameter is the name of the
database to retrieve the list of tables from. Upon failure,
<function>mysql_list_tables</function> returns &false;.
</para>
<para>
For downward compatibility, the function alias named
<function>mysql_listtables</function> can be used. This is
deprecated however and is not recommended.
</para>
<note>
<para>
The function <function>mysql_list_tables</function> is deprecated. It
is preferable to use <function>mysql_query</function> to issue a
SQL <literal>SHOW TABLES [FROM db_name] [LIKE 'pattern']</literal> statement instead.
</para>
</note>
</refsect1>
<refsect1 role="examples">
&reftitle.examples;
<para>
<example>
<title><function>mysql_list_tables</function> alternative example</title>
@ -70,10 +86,25 @@ mysql_free_result($result);
</programlisting>
</example>
</para>
</refsect1>
<refsect1 role="notes">
&reftitle.notes;
<note>
<para>
&info.deprecated.alias;
<function>mysql_listtables</function>
</para>
</note>
</refsect1>
<refsect1 role="seealso">
&reftitle.seealso;
<para>
See also
<function>mysql_list_dbs</function> and
<function>mysql_tablename</function>.
<simplelist>
<member><function>mysql_list_dbs</function></member>
<member><function>mysql_tablename</function></member>
</simplelist>
</para>
</refsect1>
</refentry>

View file

@ -1,21 +1,41 @@
<?xml version="1.0" encoding="iso-8859-1"?>
<!-- $Revision: 1.8 $ -->
<!-- splitted from ./en/functions/mysql.xml, last change in rev 1.2 -->
<!-- $Revision: 1.9 $ -->
<refentry id="function.mysql-num-fields">
<refnamediv>
<refname>mysql_num_fields</refname>
<refpurpose>Get number of fields in result</refpurpose>
</refnamediv>
<refsect1>
<title>Description</title>
<refsect1 role="description">
&reftitle.description;
<methodsynopsis>
<type>int</type><methodname>mysql_num_fields</methodname>
<methodparam><type>resource</type><parameter>result</parameter></methodparam>
</methodsynopsis>
<para>
<function>mysql_num_fields</function> returns the number of
fields in the result set <parameter>result</parameter>.
Retrieves the number of fields from a query.
</para>
</refsect1>
<refsect1 role="parameters">
&reftitle.parameters;
<para>
<variablelist>
&mysql.result.description;
</variablelist>
</para>
</refsect1>
<refsect1 role="returnvalues">
&reftitle.returnvalues;
<para>
Returns the number of fields in the result set <type>resource</type> on
success, or &false; on failure.
</para>
</refsect1>
<refsect1 role="examples">
&reftitle.examples;
<para>
<example>
<title>A <function>mysql_num_fields</function> example</title>
@ -35,16 +55,27 @@ echo mysql_num_fields($result);
</programlisting>
</example>
</para>
</refsect1>
<refsect1 role="notes">
&reftitle.notes;
<note>
<para>
&info.deprecated.alias;
<function>mysql_numfields</function>
</para>
</note>
</refsect1>
<refsect1 role="seealso">
&reftitle.seealso;
<para>
For downward compatibility <function>mysql_numfields</function>
can also be used. This is deprecated however.
</para>
<para>
See also
<function>mysql_select_db</function>,
<function>mysql_query</function>,
<function>mysql_fetch_field</function> and
<function>mysql_num_rows</function>.
<simplelist>
<member><function>mysql_select_db</function></member>
<member><function>mysql_query</function></member>
<member><function>mysql_fetch_field</function></member>
<member><function>mysql_num_rows</function></member>
</simplelist>
</para>
</refsect1>
</refentry>

View file

@ -1,22 +1,43 @@
<?xml version="1.0" encoding="iso-8859-1"?>
<!-- $Revision: 1.7 $ -->
<!-- splitted from ./en/functions/mysql.xml, last change in rev 1.2 -->
<!-- $Revision: 1.8 $ -->
<refentry id="function.mysql-num-rows">
<refnamediv>
<refname>mysql_num_rows</refname>
<refpurpose>Get number of rows in result</refpurpose>
</refnamediv>
<refsect1>
<title>Description</title>
<refsect1 role="description">
&reftitle.description;
<methodsynopsis>
<type>int</type><methodname>mysql_num_rows</methodname>
<methodparam><type>resource</type><parameter>result</parameter></methodparam>
</methodsynopsis>
<para>
<function>mysql_num_rows</function> returns the number of rows in
a result set. This command is only valid for SELECT statements.
To retrieve the number of rows affected by a INSERT, UPDATE or
DELETE query, use <function>mysql_affected_rows</function>.
Retrieves the number of rows from a result set. This command is only valid
for SELECT statements. To retrieve the number of rows affected by a INSERT,
UPDATE, or DELETE query, use <function>mysql_affected_rows</function>.
</para>
</refsect1>
<refsect1 role="parameters">
&reftitle.parameters;
<para>
<variablelist>
&mysql.result.description;
</variablelist>
</para>
</refsect1>
<refsect1 role="returnvalues">
&reftitle.returnvalues;
<para>
The number of rows in a result set on success, or &false; on failure.
</para>
</refsect1>
<refsect1 role="examples">
&reftitle.examples;
<para>
<example>
<title><function>mysql_num_rows</function> example</title>
<programlisting role="php">
@ -36,6 +57,10 @@ echo "$num_rows Rows\n";
</programlisting>
</example>
</para>
</refsect1>
<refsect1 role="notes">
&reftitle.notes;
<note>
<para>
If you use <function>mysql_unbuffered_query</function>,
@ -44,17 +69,24 @@ echo "$num_rows Rows\n";
retrieved.
</para>
</note>
<note>
<para>
&info.deprecated.alias;
<function>mysql_numrows</function>
</para>
</note>
</refsect1>
<refsect1 role="seealso">
&reftitle.seealso;
<para>
See also
<function>mysql_affected_rows</function>,
<function>mysql_connect</function>,
<function>mysql_data_seek</function>,
<function>mysql_select_db</function> and
<function>mysql_query</function>.
</para>
<para>
For downward compatibility <function>mysql_numrows</function> can
also be used. This is deprecated however.
<simplelist>
<member><function>mysql_affected_rows</function></member>
<member><function>mysql_connect</function></member>
<member><function>mysql_data_seek</function></member>
<member><function>mysql_select_db</function></member>
<member><function>mysql_query</function></member>
</simplelist>
</para>
</refsect1>
</refentry>

View file

@ -1,15 +1,13 @@
<?xml version="1.0" encoding="iso-8859-1"?>
<!-- $Revision: 1.8 $ -->
<!-- splitted from ./en/functions/mysql.xml, last change in rev 1.2 -->
<!-- $Revision: 1.9 $ -->
<refentry id="function.mysql-pconnect">
<refnamediv>
<refname>mysql_pconnect</refname>
<refpurpose>
Open a persistent connection to a MySQL server
</refpurpose>
<refpurpose>Open a persistent connection to a MySQL server</refpurpose>
</refnamediv>
<refsect1>
<title>Description</title>
<refsect1 role="description">
&reftitle.description;
<methodsynopsis>
<type>resource</type><methodname>mysql_pconnect</methodname>
<methodparam choice="opt"><type>string</type><parameter>server</parameter></methodparam>
@ -18,37 +16,9 @@
<methodparam choice="opt"><type>int</type><parameter>client_flags</parameter></methodparam>
</methodsynopsis>
<para>
Returns a positive MySQL persistent link identifier on success,
or &false; on error.
Establishes a persistent connection to a MySQL server.
</para>
<para>
<function>mysql_pconnect</function> establishes a connection
to a MySQL server. The following defaults are assumed for
missing optional parameters: <parameter>server</parameter> =
'localhost:3306', <parameter>username</parameter> = name of the
user that owns the server process and
<parameter>password</parameter> = empty password.
The <parameter>client_flags</parameter>
parameter can be a combination of the constants
MYSQL_CLIENT_COMPRESS, MYSQL_CLIENT_IGNORE_SPACE or
MYSQL_CLIENT_INTERACTIVE.
</para>
<para>
The <parameter>server</parameter> parameter can also include a port
number. e.g. &quot;hostname:port&quot; or a path to a socket
e.g. &quot;:/path/to/socket&quot; for the localhost.
<note>
<para>
Support for &quot;:port&quot; was added in 3.0B4.
</para>
<para>
Support for the &quot;:/path/to/socket&quot; was added in
3.0.10.
</para>
</note>
</para>
<!-- TODO move the story to features.persistent, and refer to that -->
<!-- TODO: Integrate this information more nicely with features.persistent -->
<para>
<function>mysql_pconnect</function> acts very much like
<function>mysql_connect</function> with two major differences.
@ -65,13 +35,110 @@
open for future use (<function>mysql_close</function> will not
close links established by <function>mysql_pconnect</function>).
</para>
<para>
The optional <parameter>client_flags</parameter> parameter became
available in PHP 4.3.0.
</para>
<para>
This type of link is therefore called 'persistent'.
</para>
</refsect1>
<refsect1 role="parameters">
&reftitle.parameters;
<para>
<variablelist>
<varlistentry>
<term><parameter>server</parameter></term>
<listitem>
<para>
The MySQL server. It can also include a port number. e.g.
"hostname:port" or a path to a local socket e.g. ":/path/to/socket" for
the localhost.
</para>
<para>
If the PHP directive <link linkend="ini.mysql.default-host">
mysql.default_host</link> is undefined (default), then the default
value is 'localhost:3306'
</para>
</listitem>
</varlistentry>
<varlistentry>
<term><parameter>username</parameter></term>
<listitem>
<para>
The username. Default value is the name of the user that owns the
server process.
</para>
</listitem>
</varlistentry>
<varlistentry>
<term><parameter>password</parameter></term>
<listitem>
<para>
The password. Default value is an empty password.
</para>
</listitem>
</varlistentry>
<varlistentry>
<term><parameter>client_flags</parameter></term>
<listitem>
<para>
The <parameter>client_flags</parameter> parameter can be a combination
of the following constants:
<constant>MYSQL_CLIENT_COMPRESS</constant>,
<constant>MYSQL_CLIENT_IGNORE_SPACE</constant> or
<constant>MYSQL_CLIENT_INTERACTIVE</constant>.
</para>
</listitem>
</varlistentry>
</variablelist>
</para>
</refsect1>
<refsect1 role="returnvalues">
&reftitle.returnvalues;
<para>
Returns a MySQL persistent link identifier on success, or &false; on
failure.
</para>
</refsect1>
<refsect1 role="changelog">
&reftitle.changelog;
<para>
<informaltable>
<tgroup cols="2">
<thead>
<row>
<entry>&Version;</entry>
<entry>&Description;</entry>
</row>
</thead>
<tbody>
<row>
<entry>4.3.0</entry>
<entry>
Added the <parameter>client_flags</parameter> parameter.
</entry>
</row>
<row>
<entry>3.0.10</entry>
<entry>
Added support for ":/path/to/socket" with
<parameter>server</parameter>.
</entry>
</row>
<row>
<entry>3.0.0</entry>
<entry>
Added support for ":port" with <parameter>server</parameter>.
</entry>
</row>
</tbody>
</tgroup>
</informaltable>
</para>
</refsect1>
<refsect1 role="notes">
&reftitle.notes;
<note>
<para>
Note, that these kind of links only work if you are using
@ -87,6 +154,24 @@
connections allowed by MySQL.
</para>
</warning>
<note>
<para>
You can suppress the error message on failure by prepending
a <link linkend="language.operators.errorcontrol">@</link>
to the function name.
</para>
</note>
</refsect1>
<refsect1 role="seealso">
&reftitle.seealso;
<para>
<simplelist>
<member><function>mysql_connect</function></member>
<member><link linkend="features.persistent-connections">Persistent
Database Connections</link></member>
</simplelist>
</para>
</refsect1>
</refentry>

View file

@ -1,26 +1,45 @@
<?xml version="1.0" encoding="iso-8859-1"?>
<!-- $Revision: 1.7 $ -->
<!-- splitted from ./en/functions/mysql.xml, last change in rev 1.100 -->
<!-- $Revision: 1.8 $ -->
<refentry id="function.mysql-ping">
<refnamediv>
<refname>mysql_ping</refname>
<refpurpose>Ping a server connection or reconnect if there is no connection</refpurpose>
</refnamediv>
<refsect1>
<title>Description</title>
<refsect1 role="description">
&reftitle.description;
<methodsynopsis>
<type>bool</type><methodname>mysql_ping</methodname>
<methodparam choice="opt"><type>resource</type><parameter>link_identifier</parameter></methodparam>
</methodsynopsis>
<para>
<function>mysql_ping</function> checks whether or not the connection to
Checks whether or not the connection to
the server is working. If it has gone down, an automatic reconnection is
attempted. This function can be used by scripts that remain idle for a
long while, to check whether or not the server has closed the connection
and reconnect if necessary.
<function>mysql_ping</function> returns &true; if the connection to the
server is working, otherwise &false;.
</para>
</refsect1>
<refsect1 role="parameters">
&reftitle.parameters;
<para>
<variablelist>
&mysql.linkid.description;
</variablelist>
</para>
</refsect1>
<refsect1 role="returnvalues">
&reftitle.returnvalues;
<para>
Returns &true; if the connection to the server MySQL server is working,
otherwise &false;.
</para>
</refsect1>
<refsect1 role="examples">
&reftitle.examples;
<para>
<example>
<title>A <function>mysql_ping</function> example</title>
@ -53,10 +72,15 @@ $result2 = mysql_query($sql2);
</programlisting>
</example>
</para>
</refsect1>
<refsect1 role="seealso">
&reftitle.seealso;
<para>
See also
<function>mysql_thread_id</function> and
<function>mysql_list_processes</function>.
<simplelist>
<member><function>mysql_thread_id</function></member>
<member><function>mysql_list_processes</function></member>
</simplelist>
</para>
</refsect1>
</refentry>

View file

@ -1,5 +1,5 @@
<?xml version="1.0" encoding="iso-8859-1"?>
<!-- $Revision: 1.14 $ -->
<!-- $Revision: 1.15 $ -->
<!-- splitted from ./en/functions/mysql.xml, last change in rev 1.62 -->
<refentry id="function.mysql-query">
<refnamediv>
@ -36,20 +36,7 @@
</para>
</listitem>
</varlistentry>
<varlistentry>
<term><parameter>link_identifier</parameter></term>
<listitem>
<para>
A link identifier, as returned by <function>mysql_connect</function>.
</para>
<para>
If <parameter>link_identifier</parameter> isn't specified, the last
opened link is assumed. If no link is open, the function tries
to establish a link as if <function>mysql_connect</function> was
called with no arguments, and use it. The result of the query is buffered.
</para>
</listitem>
</varlistentry>
&mysql.linkid.description;
</variablelist>
</para>
</refsect1>
@ -59,13 +46,13 @@
<para>
For SELECT, SHOW, DESCRIBE or EXPLAIN statements,
<function>mysql_query</function>
returns a <type>resource</type> on success, and &false; on
returns a <type>resource</type> on success, or &false; on
error.
</para>
<para>
For other type of SQL statements, UPDATE, DELETE, DROP, etc,
<function>mysql_query</function> returns &true; on success
and &false; on error.
or &false; on error.
</para>
<para>
The returned result resource should be passed to

View file

@ -1,49 +1,24 @@
<?xml version="1.0" encoding="iso-8859-1"?>
<!-- $Revision: 1.22 $ -->
<!-- splitted from ./en/functions/mysql.xml, last change in rev 1.100 -->
<!-- $Revision: 1.23 $ -->
<refentry id="function.mysql-real-escape-string">
<refnamediv>
<refname>mysql_real_escape_string</refname>
<refpurpose>
Escapes special characters in a string for use in a SQL statement
</refpurpose>
<refpurpose>Escapes special characters in a string for use in a SQL statement</refpurpose>
</refnamediv>
<refsect1>
<title>Description</title>
<refsect1 role="description">
&reftitle.description;
<methodsynopsis>
<type>string</type><methodname>mysql_real_escape_string</methodname>
<methodparam><type>string</type><parameter>unescaped_string</parameter></methodparam>
<methodparam choice="opt"><type>resource</type><parameter>link_identifier</parameter></methodparam>
</methodsynopsis>
<para>
<variablelist>
<varlistentry>
<term><parameter>unescaped_string</parameter></term>
<listitem><simpara>The string to escape</simpara>
</listitem>
</varlistentry>
<varlistentry>
<term><parameter>link_identifier</parameter> (optional)</term>
<listitem><simpara>The mysql connection resource</simpara></listitem>
</varlistentry>
</variablelist>
Escapes special characters in the <parameter>unescaped_string</parameter>,
taking into account the current character set of the connection so that it
is safe to place it in a <function>mysql_query</function>. If binary data
is to be inserted, this function must be used.
</para>
<para>
This function will escape special characters in the
<parameter>unescaped_string</parameter>, taking into account the current
character set of the connection so that it is safe to place it in a
<function>mysql_query</function>. If binary data is to be inserted, this function
must be used.
</para>
<note>
<para>
A MySQL connection is required before using
<function>mysql_real_escape_string</function> otherwise an error of
level <literal>E_WARNING</literal> is generated, and &false; is
returned. If <parameter>link_identifier</parameter> isn't defined, the
last MySQL connection is used.
</para>
</note>
<para>
<function>mysql_real_escape_string</function> calls MySQL's library function
mysql_escape_string, which prepends backslashes to the following characters:
@ -51,6 +26,38 @@
<literal>\r</literal>, <literal>\</literal>, <literal>'</literal>,
<literal>"</literal> and <literal>\x1a</literal>.
</para>
<para>
This function must always (with few exceptions) be used to make data
safe before sending a query to MySQL.
</para>
</refsect1>
<refsect1 role="parameters">
&reftitle.parameters;
<para>
<variablelist>
<varlistentry>
<term><parameter>unescaped_string</parameter></term>
<listitem>
<para>
The string that is to be escaped.
</para>
</listitem>
</varlistentry>
&mysql.linkid.description;
</variablelist>
</para>
</refsect1>
<refsect1 role="returnvalues">
&reftitle.returnvalues;
<para>
Returns the escaped string, or &false; on error.
</para>
</refsect1>
<refsect1 role="examples">
&reftitle.examples;
<para>
<example>
<title>Simple <function>mysql_real_escape_string</function> example</title>
@ -70,21 +77,6 @@ $query = sprintf("SELECT * FROM users WHERE user='%s' AND password='%s'",
</programlisting>
</example>
</para>
<para>
This function must always (with few exceptions) be used to make data
safe before sending a query to MySQL.
</para>
<note>
<para>
If <link linkend="ini.magic-quotes-gpc">magic_quotes_gpc</link> is enabled,
first apply <function>stripslashes</function> to the data. Using this function
on data which has already been escaped will escape the data twice.
</para>
</note>
<para>
If this function is not used to escape data, the query is vulnerable to
<link linkend="security.database.sql-injection">SQL Injection Attacks</link>.
</para>
<para>
<example>
<title>An example SQL Injection Attack</title>
@ -161,6 +153,32 @@ mysql_query($query);
</para>
</example>
</para>
</refsect1>
<refsect1 role="notes">
&reftitle.notes;
<note>
<para>
A MySQL connection is required before using
<function>mysql_real_escape_string</function> otherwise an error of
level <literal>E_WARNING</literal> is generated, and &false; is
returned. If <parameter>link_identifier</parameter> isn't defined, the
last MySQL connection is used.
</para>
</note>
<note>
<para>
If <link linkend="ini.magic-quotes-gpc">magic_quotes_gpc</link> is enabled,
first apply <function>stripslashes</function> to the data. Using this function
on data which has already been escaped will escape the data twice.
</para>
</note>
<note>
<para>
If this function is not used to escape data, the query is vulnerable to
<link linkend="security.database.sql-injection">SQL Injection Attacks</link>.
</para>
</note>
<note>
<simpara>
<function>mysql_real_escape_string</function> does not escape
@ -169,15 +187,18 @@ mysql_query($query);
or <literal>REVOKE</literal>.
</simpara>
</note>
</refsect1>
<refsect1 role="seealso">
&reftitle.seealso;
<para>
See also
<function>mysql_client_encoding</function>,
<function>addslashes</function>,
<function>stripslashes</function>,
the <link linkend="ini.magic-quotes-gpc">magic_quotes_gpc</link>,
and the
<link linkend="ini.magic-quotes-runtime">magic_quotes_runtime</link>
directive.
<simplelist>
<member><function>mysql_client_encoding</function></member>
<member><function>addslashes</function></member>
<member><function>stripslashes</function></member>
<member>The <link linkend="ini.magic-quotes-gpc">magic_quotes_gpc</link> directive</member>
<member>The <link linkend="ini.magic-quotes-runtime">magic_quotes_runtime</link> directive</member>
</simplelist>
</para>
</refsect1>
</refentry>

View file

@ -1,13 +1,13 @@
<?xml version="1.0" encoding="iso-8859-1"?>
<!-- $Revision: 1.9 $ -->
<!-- splitted from ./en/functions/mysql.xml, last change in rev 1.2 -->
<!-- $Revision: 1.10 $ -->
<refentry id="function.mysql-result">
<refnamediv>
<refname>mysql_result</refname>
<refpurpose>Get result data</refpurpose>
</refnamediv>
<refsect1>
<title>Description</title>
<refsect1 role="description">
&reftitle.description;
<methodsynopsis>
<type>mixed</type><methodname>mysql_result</methodname>
<methodparam><type>resource</type><parameter>result</parameter></methodparam>
@ -15,12 +15,7 @@
<methodparam choice="opt"><type>mixed</type><parameter>field</parameter></methodparam>
</methodsynopsis>
<para>
<function>mysql_result</function> returns the contents of one
cell from a MySQL result set. The field argument can be the
field's offset, or the field's name, or the field's table dot
field name (tablename.fieldname). If the column name has been
aliased ('select foo as bar from...'), use the alias instead of
the column name.
Retrieves the contents of one cell from a MySQL result set.
</para>
<para>
When working on large result sets, you should consider using one
@ -31,10 +26,50 @@
numeric offset for the field argument is much quicker than
specifying a fieldname or tablename.fieldname argument.
</para>
</refsect1>
<refsect1 role="parameters">
&reftitle.parameters;
<para>
Calls to <function>mysql_result</function> should not be mixed
with calls to other functions that deal with the result set.
<variablelist>
&mysql.result.description;
<varlistentry>
<term><parameter>row</parameter></term>
<listitem>
<para>
The row number from the result that's being retrieved. Row numbers
start at <literal>0</literal>.
</para>
</listitem>
</varlistentry>
<varlistentry>
<term><parameter>field</parameter></term>
<listitem>
<para>
The name or offset of the field being retrieved.
</para>
<para>
It can be the field's offset, the field's name, or the field's table
dot field name (tablename.fieldname). If the column name has been
aliased ('select foo as bar from...'), use the alias instead of the
column name. If undefined, the first field is retrieved.
</para>
</listitem>
</varlistentry>
</variablelist>
</para>
</refsect1>
<refsect1 role="returnvalues">
&reftitle.returnvalues;
<para>
The contents of one cell from a MySQL result set on success, or
&false; on failure.
</para>
</refsect1>
<refsect1 role="examples">
&reftitle.examples;
<para>
<example>
<title><function>mysql_result</function> example</title>
@ -57,12 +92,27 @@ mysql_close($link);
</programlisting>
</example>
</para>
</refsect1>
<refsect1 role="notes">
&reftitle.notes;
<note>
<para>
Calls to <function>mysql_result</function> should not be mixed
with calls to other functions that deal with the result set.
</para>
</note>
</refsect1>
<refsect1 role="seealso">
&reftitle.seealso;
<para>
Recommended high-performance alternatives :
<function>mysql_fetch_row</function>,
<function>mysql_fetch_array</function>,
<function>mysql_fetch_assoc</function> and
<function>mysql_fetch_object</function>.
<simplelist>
<member><function>mysql_fetch_row</function></member>
<member><function>mysql_fetch_array</function></member>
<member><function>mysql_fetch_assoc</function></member>
<member><function>mysql_fetch_object</function></member>
</simplelist>
</para>
</refsect1>
</refentry>

View file

@ -1,33 +1,51 @@
<?xml version="1.0" encoding="iso-8859-1"?>
<!-- $Revision: 1.9 $ -->
<!-- splitted from ./en/functions/mysql.xml, last change in rev 1.2 -->
<!-- $Revision: 1.10 $ -->
<refentry id="function.mysql-select-db">
<refnamediv>
<refname>mysql_select_db</refname>
<refpurpose>Select a MySQL database</refpurpose>
</refnamediv>
<refsect1>
<title>Description</title>
<refsect1 role="description">
&reftitle.description;
<methodsynopsis>
<type>bool</type><methodname>mysql_select_db</methodname>
<methodparam><type>string</type><parameter>database_name</parameter></methodparam>
<methodparam choice="opt"><type>resource</type><parameter>link_identifier</parameter></methodparam>
</methodsynopsis>
<para>
Sets the current active database on the server that's associated with the
specified link identifier. Every subsequent call to
<function>mysql_query</function> will be made on the active database.
</para>
</refsect1>
<refsect1 role="parameters">
&reftitle.parameters;
<para>
<variablelist>
<varlistentry>
<term><parameter>database_name</parameter></term>
<listitem>
<para>
The name of the database that is to be selected.
</para>
</listitem>
</varlistentry>
&mysql.linkid.description;
</variablelist>
</para>
</refsect1>
<refsect1 role="returnvalues">
&reftitle.returnvalues;
<para>
&return.success;
</para>
<para>
<function>mysql_select_db</function> sets the current active
database on the server that's associated with the specified link
identifier. If no link identifier is specified, the last opened
link is assumed. If no link is open, the function will try to
establish a link as if <function>mysql_connect</function> was
called without arguments, and use it.
</para>
<para>
Every subsequent call to <function>mysql_query</function> will be
made on the active database.
</para>
</refsect1>
<refsect1 role="examples">
&reftitle.examples;
<para>
<example>
<title><function>mysql_select_db</function> example</title>
@ -50,15 +68,26 @@ if (!$db_selected) {
</programlisting>
</example>
</para>
</refsect1>
<refsect1 role="notes">
&reftitle.notes;
<note>
<para>
&info.deprecated.alias;
<function>mysql_createdb</function>
</para>
</note>
</refsect1>
<refsect1 role="seealso">
&reftitle.seealso;
<para>
See also
<function>mysql_connect</function>,
<function>mysql_pconnect</function> and
<function>mysql_query</function>.
</para>
<para>
For downward compatibility <function>mysql_selectdb</function>
can also be used. This is deprecated however.
<simplelist>
<member><function>mysql_connect</function></member>
<member><function>mysql_pconnect</function></member>
<member><function>mysql_query</function></member>
</simplelist>
</para>
</refsect1>
</refentry>

View file

@ -1,5 +1,5 @@
<?xml version="1.0" encoding="iso-8859-1"?>
<!-- $Revision: 1.10 $ -->
<!-- $Revision: 1.11 $ -->
<!-- splitted from ./en/functions/mysql.xml, last change in rev 1.62 -->
<refentry id="function.mysql-stat">
<refnamediv>
@ -20,14 +20,7 @@
&reftitle.parameters;
<para>
<variablelist>
<varlistentry>
<term><parameter>link_identifier</parameter></term>
<listitem>
<para>
Link to the MySQL connection.
</para>
</listitem>
</varlistentry>
&mysql.linkid.description;
</variablelist>
</para>
</refsect1>

View file

@ -1,27 +1,68 @@
<?xml version="1.0" encoding="iso-8859-1"?>
<!-- $Revision: 1.13 $ -->
<!-- splitted from ./en/functions/mysql.xml, last change in rev 1.2 -->
<!-- $Revision: 1.14 $ -->
<refentry id="function.mysql-tablename">
<refnamediv>
<refname>mysql_tablename</refname>
<refpurpose>Get table name of field</refpurpose>
</refnamediv>
<refsect1>
<title>Description</title>
<refsect1 role="description">
&reftitle.description;
<methodsynopsis>
<type>string</type><methodname>mysql_tablename</methodname>
<methodparam><type>resource</type><parameter>result</parameter></methodparam>
<methodparam><type>int</type><parameter>i</parameter></methodparam>
</methodsynopsis>
<para>
<function>mysql_tablename</function> takes a result pointer
returned by the <function>mysql_list_tables</function> function
as well as an integer index and returns the name of a table. The
<function>mysql_num_rows</function> function may be used to
determine the number of tables in the result pointer.
Retrieves the table name from a <parameter>result</parameter>.
</para>
<para>
This function deprecated. It is preferable to use
<function>mysql_query</function> to issue a SQL <literal>SHOW TABLES
[FROM db_name] [LIKE 'pattern']</literal> statement instead.
</para>
</refsect1>
<refsect1 role="parameters">
&reftitle.parameters;
<para>
<variablelist>
<varlistentry>
<term><parameter>result</parameter></term>
<listitem>
<para>
A result pointer <type>resource</type> that's returned from
<function>mysql_list_tables</function>.
</para>
</listitem>
</varlistentry>
<varlistentry>
<term><parameter>i</parameter></term>
<listitem>
<para>
The integer index (row/table number)
</para>
</listitem>
</varlistentry>
</variablelist>
</para>
</refsect1>
<refsect1 role="returnvalues">
&reftitle.returnvalues;
<para>
The name of the table on success, or &false; on failure.
</para>
<para>
Use the <function>mysql_tablename</function> function to
traverse this result pointer, or any function for result tables,
such as <function>mysql_fetch_array</function>.
</para>
</refsect1>
<refsect1 role="examples">
&reftitle.examples;
<para>
<example>
<title><function>mysql_tablename</function> example</title>
<programlisting role="php">
@ -40,11 +81,26 @@ mysql_free_result($result);
</programlisting>
</example>
</para>
</refsect1>
<refsect1 role="notes">
&reftitle.notes;
<note>
<para>
The <function>mysql_num_rows</function> function may be used to
determine the number of tables in the result pointer.
</para>
</note>
</refsect1>
<refsect1 role="seealso">
&reftitle.seealso;
<para>
See also
<function>mysql_list_tables</function>,
<function>mysql_field_table</function>, and
<function>mysql_db_name</function>.
<simplelist>
<member><function>mysql_list_tables</function></member>
<member><function>mysql_field_table</function></member>
<member><function>mysql_db_name</function></member>
</simplelist>
</para>
</refsect1>
</refentry>

View file

@ -1,24 +1,42 @@
<?xml version="1.0" encoding="iso-8859-1"?>
<!-- $Revision: 1.8 $ -->
<!-- splitted from ./en/functions/mysql.xml, last change in rev 1.100 -->
<!-- $Revision: 1.9 $ -->
<refentry id="function.mysql-thread-id">
<refnamediv>
<refname>mysql_thread_id</refname>
<refpurpose>Return the current thread ID</refpurpose>
</refnamediv>
<refsect1>
<title>Description</title>
<refsect1 role="description">
&reftitle.description;
<methodsynopsis>
<type>int</type><methodname>mysql_thread_id</methodname>
<methodparam choice="opt"><type>resource</type><parameter>link_identifier</parameter></methodparam>
</methodsynopsis>
<para>
<function>mysql_thread_id</function> returns the current thread ID. If
the connection is lost and you reconnect with
<function>mysql_ping</function>, the thread ID will change. This means
you should not get the thread ID and store it for later. You should get
it when you need it.
Retrieves the current thread ID. If the connection is lost, and a reconnect
with <function>mysql_ping</function> is executed, the thread ID will
change. This means only retrieve the thread ID when needed.
</para>
</refsect1>
<refsect1 role="parameters">
&reftitle.parameters;
<para>
<variablelist>
&mysql.linkid.description;
</variablelist>
</para>
</refsect1>
<refsect1 role="returnvalues">
&reftitle.returnvalues;
<para>
The thread ID on success, or &false; on failure.
</para>
</refsect1>
<refsect1 role="examples">
&reftitle.examples;
<para>
<example>
<title><function>mysql_thread_id</function> example</title>
@ -33,9 +51,7 @@ if ($thread_id){
?>
]]>
</programlisting>
<para>
The above example would produce the following output:
</para>
&example.outputs.similar;
<screen>
<![CDATA[
current thread id is 73
@ -43,10 +59,17 @@ current thread id is 73
</screen>
</example>
</para>
</refsect1>
<refsect1 role="seealso">
&reftitle.seealso;
<para>
See also
<function>mysql_ping</function> and
<function>mysql_list_processes</function>.
<simplelist>
<member><function>mysql_ping</function></member>
<member><function>mysql_list_processes</function></member>
<member><function>mysql_</function></member>
<member><function>mysql_</function></member>
</simplelist>
</para>
</refsect1>
</refentry>

View file

@ -1,16 +1,13 @@
<?xml version="1.0" encoding="iso-8859-1"?>
<!-- $Revision: 1.8 $ -->
<!-- splitted from ./en/functions/mysql.xml, last change in rev 1.2 -->
<!-- $Revision: 1.9 $ -->
<refentry id="function.mysql-unbuffered-query">
<refnamediv>
<refname>mysql_unbuffered_query</refname>
<refpurpose>
Send an SQL query to MySQL, without fetching and buffering the
result rows
</refpurpose>
<refpurpose>Send an SQL query to MySQL, without fetching and buffering the result rows</refpurpose>
</refnamediv>
<refsect1>
<title>Description</title>
<refsect1 role="description">
&reftitle.description;
<methodsynopsis>
<type>resource</type><methodname>mysql_unbuffered_query</methodname>
<methodparam><type>string</type><parameter>query</parameter></methodparam>
@ -29,6 +26,42 @@
have to specify the optional parameter
<parameter>link_identifier</parameter>.
</para>
</refsect1>
<refsect1 role="parameters">
&reftitle.parameters;
<para>
<variablelist>
<varlistentry>
<term><parameter>query</parameter></term>
<listitem>
<para>
A SQL query
</para>
</listitem>
</varlistentry>
&mysql.linkid.description;
</variablelist>
</para>
</refsect1>
<refsect1 role="returnvalues">
&reftitle.returnvalues;
<para>
For SELECT, SHOW, DESCRIBE or EXPLAIN statements,
<function>mysql_query</function>
returns a <type>resource</type> on success, or &false; on
error.
</para>
<para>
For other type of SQL statements, UPDATE, DELETE, DROP, etc,
<function>mysql_query</function> returns &true; on success
or &false; on error.
</para>
</refsect1>
<refsect1 role="notes">
&reftitle.notes;
<note>
<para>
The benefits of <function>mysql_unbuffered_query</function> come
@ -39,8 +72,14 @@
can send a new SQL query to MySQL.
</para>
</note>
</refsect1>
<refsect1 role="seealso">
&reftitle.seealso;
<para>
See also <function>mysql_query</function>.
<simplelist>
<member><function>mysql_query</function></member>
</simplelist>
</para>
</refsect1>
</refentry>