mirror of
https://github.com/sigmasternchen/php-doc-en
synced 2025-03-16 00:48:54 +00:00
- added more samples
- marked undocumented functions for embedded server and replication as experimental git-svn-id: https://svn.php.net/repository/phpdoc/en/trunk@151917 c90b9560-bf6c-de11-be94-00142212c4b1
This commit is contained in:
parent
52e87979a0
commit
ba25e8d0b8
15 changed files with 107 additions and 66 deletions
|
@ -1,5 +1,5 @@
|
|||
<?xml version="1.0" encoding="iso-8859-1"?>
|
||||
<!-- $Revision: 1.10 $ -->
|
||||
<!-- $Revision: 1.11 $ -->
|
||||
<refentry id="function.mysqli-data-seek">
|
||||
<refnamediv>
|
||||
<refname>mysqli_data_seek</refname>
|
||||
|
@ -42,43 +42,6 @@
|
|||
&return.success;
|
||||
</para>
|
||||
</refsect1>
|
||||
<refsect1>
|
||||
<title>Example</title>
|
||||
<para>
|
||||
<example>
|
||||
<title>Using the mysqli_data_seek function</title>
|
||||
<programlisting role="php">
|
||||
<![CDATA[
|
||||
<?php
|
||||
|
||||
/* Open a connection */
|
||||
$link = mysqli_connect("localhost", "username", "password");
|
||||
mysqli_select_db("mydb");
|
||||
|
||||
/* Get some rows and store them */
|
||||
$query = "SELECT DINSTINCT name FROM employee ORDER BY name";
|
||||
$result = mysqli_query($query) or die(mysqli_error());
|
||||
|
||||
$rows = mysqli_store_result($result);
|
||||
|
||||
$total = mysqli_num_fields($rows);
|
||||
|
||||
if ($total > 0) { // there is at least one row
|
||||
/* Get the last employee */
|
||||
mysqli_data_seek($rows, mysqli_num_rows($result) -1);
|
||||
$employee = mysqli_fetch_row($rows);
|
||||
printf ("Employee name : %s\n", $employee[0]);
|
||||
}
|
||||
|
||||
mysqli_free_result($rows);
|
||||
mysqli_close($link);
|
||||
|
||||
?>
|
||||
]]>
|
||||
</programlisting>
|
||||
</example>
|
||||
</para>
|
||||
</refsect1>
|
||||
<refsect1>
|
||||
<title>See also</title>
|
||||
<para>
|
||||
|
@ -87,6 +50,77 @@
|
|||
<function>mysqli_num_rows</function>.
|
||||
</para>
|
||||
</refsect1>
|
||||
<refsect1>
|
||||
<title>Example</title>
|
||||
<para>
|
||||
<example>
|
||||
<title>Object oriented style</title>
|
||||
<programlisting role="php">
|
||||
<![CDATA[
|
||||
<?php
|
||||
/* Open a connection */
|
||||
$mysqli = new mysqli("localhost", "my_user", "my_password", "test");
|
||||
|
||||
$mysqli->query( "DROP TABLE IF EXISTS friends");
|
||||
$mysqli->query( "CREATE TABLE friends (id int, name varchar(30))");
|
||||
|
||||
$mysqli->query( "INSERT INTO friends VALUES (1, 'Greant'),
|
||||
(2, 'Stocker'), (3, 'Rethans'), (4, 'Wendel')");
|
||||
|
||||
/* Get some rows */
|
||||
$query = "SELECT name FROM friends ORDER BY name";
|
||||
$result = $mysqli->query( $query) or die(mysqli_error($link));
|
||||
|
||||
$total = $result->field_count;
|
||||
|
||||
if ($total > 0) { // there is at least one row
|
||||
/* Get the last employee */
|
||||
$result->data_seek($result->num_rows -1);
|
||||
$friend = $result->fetch_row();
|
||||
printf ("Friends name : %s\n", $friend[0]);
|
||||
}
|
||||
|
||||
$result->close();
|
||||
$mysqli->close();
|
||||
?>
|
||||
]]>
|
||||
</programlisting>
|
||||
</example>
|
||||
<example>
|
||||
<title>Object oriented style</title>
|
||||
<programlisting role="php">
|
||||
<![CDATA[
|
||||
<?php
|
||||
/* Open a connection */
|
||||
$link = mysqli_connect("localhost", "my_user", "my_password", "test");
|
||||
|
||||
mysqli_query($link, "DROP TABLE IF EXISTS friends");
|
||||
mysqli_query($link, "CREATE TABLE friends (id int, name varchar(30))");
|
||||
|
||||
mysqli_query($link, "INSERT INTO friends VALUES (1, 'Greant'),
|
||||
(2, 'Stocker'), (3, 'Rethans'), (4, 'Wendel')");
|
||||
|
||||
/* Get some rows */
|
||||
$query = "SELECT name FROM friends ORDER BY name";
|
||||
$result = mysqli_query($link, $query) or die(mysqli_error($link));
|
||||
|
||||
$total = mysqli_num_fields($result);
|
||||
|
||||
if ($total > 0) { /* there is at least one row */
|
||||
/* Get the last employee */
|
||||
mysqli_data_seek($result, mysqli_num_rows($result) -1);
|
||||
$friend = mysqli_fetch_row($result);
|
||||
printf ("Friends name : %s\n", $friend[0]);
|
||||
}
|
||||
|
||||
mysqli_free_result($result);
|
||||
mysqli_close($link);
|
||||
?>
|
||||
]]>
|
||||
</programlisting>
|
||||
</example>
|
||||
</para>
|
||||
</refsect1>
|
||||
</refentry>
|
||||
|
||||
<!-- Keep this comment at the end of the file
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
<?xml version="1.0" encoding="iso-8859-1"?>
|
||||
<!-- $Revision: 1.5 $ -->
|
||||
<!-- $Revision: 1.6 $ -->
|
||||
<refentry id="function.mysqli-debug">
|
||||
<refnamediv>
|
||||
<refname>mysqli_debug</refname>
|
||||
|
@ -16,6 +16,12 @@
|
|||
operations using the Fred Fish debugging library. The <parameter>debug</parameter>
|
||||
parameter is a string representing the debugging operation to perform.
|
||||
</para>
|
||||
<note>
|
||||
<para>
|
||||
To use the <function>mysqli_debug</function> function you must complile
|
||||
the MySQL client library to support debugging.
|
||||
</para>
|
||||
</note>
|
||||
</refsect1>
|
||||
<refsect1>
|
||||
<title>Return values</title>
|
||||
|
@ -30,8 +36,8 @@
|
|||
<![CDATA[
|
||||
<?php
|
||||
|
||||
/* Create a trace file in '/tmp/client.trace' on the local (client) machine: */
|
||||
mysqli_debug("d:t:0,/tmp/client.trace");
|
||||
/* Create a trace file in '/tmp/client.trace' on the local (client) machine: */
|
||||
mysqli_debug("d:t:0,/tmp/client.trace");
|
||||
|
||||
?>
|
||||
]]>
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
<?xml version="1.0" encoding="iso-8859-1"?>
|
||||
<!-- $Revision: 1.2 $ -->
|
||||
<!-- $Revision: 1.3 $ -->
|
||||
<refentry id="function.mysqli-disable-reads-from-master">
|
||||
<refnamediv>
|
||||
<refname>mysqli_disable_reads_from_master</refname>
|
||||
|
@ -12,7 +12,7 @@
|
|||
<methodparam><type>resource</type><parameter>link</parameter></methodparam>
|
||||
</methodsynopsis>
|
||||
|
||||
&warn.undocumented.func;
|
||||
&warn.experimental.func;
|
||||
|
||||
</refsect1>
|
||||
</refentry>
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
<?xml version="1.0" encoding="iso-8859-1"?>
|
||||
<!-- $Revision: 1.4 $ -->
|
||||
<!-- $Revision: 1.5 $ -->
|
||||
<refentry id="function.mysqli-disable-rpl-parse">
|
||||
<refnamediv>
|
||||
<refname>mysqli_disable_rpl_parse</refname>
|
||||
|
@ -12,7 +12,7 @@
|
|||
<methodparam><type>object</type><parameter>link</parameter></methodparam>
|
||||
</methodsynopsis>
|
||||
|
||||
&warn.undocumented.func;
|
||||
&warn.experimental.func;
|
||||
|
||||
</refsect1>
|
||||
</refentry>
|
||||
|
|
|
@ -1,8 +1,9 @@
|
|||
<?xml version="1.0" encoding="iso-8859-1"?>
|
||||
<!-- $Revision: 1.6 $ -->
|
||||
<!-- $Revision: 1.7 $ -->
|
||||
<refentry id="function.mysqli-dump-debug-info">
|
||||
<refnamediv>
|
||||
<refname>mysqli_dump_debug_info</refname>
|
||||
<refname>mysqli->dump_debug_info</refname>
|
||||
<refpurpose>Dump debugging information into the log</refpurpose>
|
||||
</refnamediv>
|
||||
<refsect1>
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
<?xml version="1.0" encoding="iso-8859-1"?>
|
||||
<!-- $Revision: 1.1 $ -->
|
||||
<!-- $Revision: 1.2 $ -->
|
||||
<refentry id="function.mysqli-embedded-connect">
|
||||
<refnamediv>
|
||||
<refname>mysqli_embedded_connect</refname>
|
||||
|
@ -12,7 +12,7 @@
|
|||
<methodparam><type>void</type><parameter></parameter></methodparam>
|
||||
</methodsynopsis>
|
||||
|
||||
&warn.undocumented.func;
|
||||
&warn.experimental.func;
|
||||
|
||||
</refsect1>
|
||||
</refentry>
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
<?xml version="1.0" encoding="iso-8859-1"?>
|
||||
<!-- $Revision: 1.5 $ -->
|
||||
<!-- $Revision: 1.6 $ -->
|
||||
<refentry id="function.mysqli-enable-reads-from-master">
|
||||
<refnamediv>
|
||||
<refname>mysqli_enable_reads_from_master</refname>
|
||||
|
@ -12,7 +12,7 @@
|
|||
<methodparam><type>object</type><parameter>link</parameter></methodparam>
|
||||
</methodsynopsis>
|
||||
|
||||
&warn.undocumented.func;
|
||||
&warn.experimental.func;
|
||||
|
||||
</refsect1>
|
||||
</refentry>
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
<?xml version="1.0" encoding="iso-8859-1"?>
|
||||
<!-- $Revision: 1.5 $ -->
|
||||
<!-- $Revision: 1.6 $ -->
|
||||
<refentry id="function.mysqli-enable-rpl-parse">
|
||||
<refnamediv>
|
||||
<refname>mysqli_enable_rpl_parse</refname>
|
||||
|
@ -12,7 +12,7 @@
|
|||
<methodparam><type>object</type><parameter>link</parameter></methodparam>
|
||||
</methodsynopsis>
|
||||
|
||||
&warn.undocumented.func;
|
||||
&warn.experimental.func;
|
||||
|
||||
</refsect1>
|
||||
</refentry>
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
<?xml version="1.0" encoding="iso-8859-1"?>
|
||||
<!-- $Revision: 1.4 $ -->
|
||||
<!-- $Revision: 1.5 $ -->
|
||||
<refentry id="function.mysqli-master-query">
|
||||
<refnamediv>
|
||||
<refname>mysqli_master_query</refname>
|
||||
|
@ -13,7 +13,7 @@
|
|||
<methodparam><type>string</type><parameter>query</parameter></methodparam>
|
||||
</methodsynopsis>
|
||||
|
||||
&warn.undocumented.func;
|
||||
&warn.experimental.func;
|
||||
|
||||
</refsect1>
|
||||
</refentry>
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
<?xml version="1.0" encoding="iso-8859-1"?>
|
||||
<!-- $Revision: 1.4 $ -->
|
||||
<!-- $Revision: 1.5 $ -->
|
||||
<refentry id="function.mysqli-rpl-parse-enabled">
|
||||
<refnamediv>
|
||||
<refname>mysqli_rpl_parse_enabled</refname>
|
||||
|
@ -12,7 +12,7 @@
|
|||
<methodparam><type>object</type><parameter>link</parameter></methodparam>
|
||||
</methodsynopsis>
|
||||
|
||||
&warn.undocumented.func;
|
||||
&warn.experimental.func;
|
||||
|
||||
</refsect1>
|
||||
</refentry>
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
<?xml version="1.0" encoding="iso-8859-1"?>
|
||||
<!-- $Revision: 1.4 $ -->
|
||||
<!-- $Revision: 1.5 $ -->
|
||||
<refentry id="function.mysqli-rpl-probe">
|
||||
<refnamediv>
|
||||
<refname>mysqli_rpl_probe</refname>
|
||||
|
@ -12,7 +12,7 @@
|
|||
<methodparam><type>object</type><parameter>link</parameter></methodparam>
|
||||
</methodsynopsis>
|
||||
|
||||
&warn.undocumented.func;
|
||||
&warn.experimental.func;
|
||||
|
||||
</refsect1>
|
||||
</refentry>
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
<?xml version="1.0" encoding="iso-8859-1"?>
|
||||
<!-- $Revision: 1.4 $ -->
|
||||
<!-- $Revision: 1.5 $ -->
|
||||
<refentry id="function.mysqli-rpl-query-type">
|
||||
<refnamediv>
|
||||
<refname>mysqli_rpl_query_type</refname>
|
||||
|
@ -12,7 +12,7 @@
|
|||
<methodparam><type>string</type><parameter>query</parameter></methodparam>
|
||||
</methodsynopsis>
|
||||
|
||||
&warn.undocumented.func;
|
||||
&warn.experimental.func;
|
||||
|
||||
</refsect1>
|
||||
</refentry>
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
<?xml version="1.0" encoding="iso-8859-1"?>
|
||||
<!-- $Revision: 1.2 $ -->
|
||||
<!-- $Revision: 1.3 $ -->
|
||||
<refentry id="function.mysqli-send-query">
|
||||
<refnamediv>
|
||||
<refname>mysqli_send_query</refname>
|
||||
|
@ -13,7 +13,7 @@
|
|||
<methodparam><type>string</type><parameter>query</parameter></methodparam>
|
||||
</methodsynopsis>
|
||||
|
||||
&warn.undocumented.func;
|
||||
&warn.experimental.func;
|
||||
|
||||
</refsect1>
|
||||
</refentry>
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
<?xml version="1.0" encoding="iso-8859-1"?>
|
||||
<!-- $Revision: 1.1 $ -->
|
||||
<!-- $Revision: 1.2 $ -->
|
||||
<refentry id="function.mysqli-server-end">
|
||||
<refnamediv>
|
||||
<refname>mysqli_server_end</refname>
|
||||
|
@ -12,7 +12,7 @@
|
|||
<void/>
|
||||
</methodsynopsis>
|
||||
|
||||
&warn.undocumented.func;
|
||||
&warn.experimental.func;
|
||||
|
||||
</refsect1>
|
||||
</refentry>
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
<?xml version="1.0" encoding="iso-8859-1"?>
|
||||
<!-- $Revision: 1.1 $ -->
|
||||
<!-- $Revision: 1.2 $ -->
|
||||
<refentry id="function.mysqli-server-init">
|
||||
<refnamediv>
|
||||
<refname>mysqli_server_init</refname>
|
||||
|
@ -12,7 +12,7 @@
|
|||
<void/>
|
||||
</methodsynopsis>
|
||||
|
||||
&warn.undocumented.func;
|
||||
&warn.experimental.func;
|
||||
|
||||
</refsect1>
|
||||
</refentry>
|
||||
|
|
Loading…
Reference in a new issue