cvs: phpdoc /en/reference/mysqli/functions mysqli-affected-rows.xml mysqli-autocommit.xml mysqli-change-user.xml mysqli-character-set-name.xml
mysqli-close.xml mysqli-commit.xml mysqli-connect.xml mysqli-data-seek.xml mysqli-debug.xml mysqli-dump-debug-info.xml mysqli-errno.xml
mysqli-error.xml mysqli-execute.xml mysqli-fetch-array.xml mysqli-fetch-assoc.xml mysqli-fetch-field.xml mysqli-fetch-fields.xml
mysqli-fetch-lengths.xml mysqli-fetch-object.xml mysqli-fetch-row.xml
| From: | John Coggeshall | Date: | Tue, 13 May 2003 23:12:16 +0000 |
| Subject: | cvs: phpdoc /en/reference/mysqli/functions mysqli-affected-rows.xml mysqli-autocommit.xml mysqli-change-user.xml mysqli-character-set-name.xml mysqli-close.xml mysqli-commit.xml mysqli-connect.xml mysqli-data-seek.xml mysqli-debug.xml mysqli-dump-debug-info.xml mysqli-errno.xml mysqli-error.xml mysqli-execute.xml mysqli-fetch-array.xml mysqli-fetch-assoc.xml mysqli-fetch-field.xml mysqli-fetch-fields.xml mysqli-fetch-lengths.xml mysqli-fetch-object.xml mysqli-fetch-row.xml |
||
| Groups: | php.doc | ||
| Request: | Send a blank email to phpdoc+get-969353436@lists.php.net to get a copy of this message | ||
john Tue May 13 19:12:16 2003 EDT
Modified files:
/phpdoc/en/reference/mysqli/functions mysqli-affected-rows.xml
mysqli-autocommit.xml
mysqli-change-user.xml
mysqli-character-set-name.xml
mysqli-close.xml
mysqli-commit.xml
mysqli-connect.xml
mysqli-data-seek.xml
mysqli-debug.xml
mysqli-dump-debug-info.xml
mysqli-errno.xml
mysqli-error.xml
mysqli-execute.xml
mysqli-fetch-array.xml
mysqli-fetch-assoc.xml
mysqli-fetch-field.xml
mysqli-fetch-fields.xml
mysqli-fetch-lengths.xml
mysqli-fetch-object.xml
mysqli-fetch-row.xml
Log:
Documented a fairly random assortment of the MySQLi functions (indicated by those files actually
modified).
Index: phpdoc/en/reference/mysqli/functions/mysqli-affected-rows.xml diff -u phpdoc/en/reference/mysqli/functions/mysqli-affected-rows.xml:1.1 phpdoc/en/reference/mysqli/functions/mysqli-affected-rows.xml:1.2 --- phpdoc/en/reference/mysqli/functions/mysqli-affected-rows.xml:1.1 Sat Mar 15 18:01:33 2003 +++ phpdoc/en/reference/mysqli/functions/mysqli-affected-rows.xml Tue May 13 19:12:15 2003 @@ -1,9 +1,9 @@ <?xml version="1.0" encoding="iso-8859-1"?> -<!-- $Revision: 1.1 $ --> +<!-- $Revision: 1.2 $ --> <refentry id="function.mysqli-affected-rows"> <refnamediv> <refname>mysqli_affected_rows</refname> - <refpurpose></refpurpose> + <refpurpose>Get the number of affected rows in a previous MySQL operation</refpurpose> </refnamediv> <refsect1> <title>Description</title> @@ -12,7 +12,75 @@ <methodparam><type>resource</type><parameter>link</parameter></methodparam> </methodsynopsis> <para> -&warn.undocumented.func; + <function>mysqli_affected_rows</function> returns the number of rows affected by the last + INSERT, UPDATE, or DELETE query associated with the provided <parameter>link</parameter> + parameter. If the last query was invalid, this function will return -1. + </para> + <note> + <para> + When deleting the entire contents of a table (i.e. 'DELETE FROM foo'), this function will + not return the number of rows that were actually deleted. + </para> + </note> + <para> + The <function>mysqli_affected_rows</function> function only works with queries which modify + a table. In order to return the number of rows from a SELECT query, use the + <function>mysqli_num_rows()</function> function instead. + </para> + <para> + <example> + <title>Delete-Query</title> + <programlisting role="php"> +<![CDATA[ +<?php + /* connect to database */ + mysqli_connect("localhost", "mysql_user", "mysql_password") or + die("Could not connect: " . mysqli_error()); + + /* this should return the correct numbers of deleted records */ + mysqli_query("DELETE FROM mytable WHERE id < 10"); + printf ("Records deleted: %d\n", mysqli_affected_rows()); + + /* without a where clause in a delete statement, it should return 0 */ + mysqli_query("DELETE FROM mytable"); + printf ("Records deleted: %d\n", mysqli_affected_rows()); +?> +]]> + </programlisting> + <para> + The above example would produce the following output: + <screen> +<![CDATA[ +Records deleted: 10 +Records deleted: 0 +]]> + </screen> + </para> + </example> + <example> + <title>Update-Query</title> + <programlisting role="php"> +<![CDATA[ +<?php + /* connect to database */ + mysqli_connect("localhost", "mysql_user", "mysql_password") or + die("Could not connect: " . mysql_error()); + + /* Update records */ + mysqli_query("UPDATE mytable SET used=1 WHERE id < 10"); + printf ("Updated records: %d\n", mysqli_affected_rows()); +?> +]]> + </programlisting> + <para> + The above example would produce the following output: + <screen> +<![CDATA[ +Updated Records: 10 +]]> + </screen> + </para> + </example> </para> </refsect1> </refentry> Index: phpdoc/en/reference/mysqli/functions/mysqli-autocommit.xml diff -u phpdoc/en/reference/mysqli/functions/mysqli-autocommit.xml:1.1 phpdoc/en/reference/mysqli/functions/mysqli-autocommit.xml:1.2 --- phpdoc/en/reference/mysqli/functions/mysqli-autocommit.xml:1.1 Sat Mar 15 18:01:33 2003 +++ phpdoc/en/reference/mysqli/functions/mysqli-autocommit.xml Tue May 13 19:12:15 2003 @@ -1,9 +1,9 @@ <?xml version="1.0" encoding="iso-8859-1"?> -<!-- $Revision: 1.1 $ --> +<!-- $Revision: 1.2 $ --> <refentry id="function.mysqli-autocommit"> <refnamediv> <refname>mysqli_autocommit</refname> - <refpurpose></refpurpose> + <refpurpose>Turns on and off auto-commiting database modifications</refpurpose> </refnamediv> <refsect1> <title>Description</title> @@ -13,7 +13,10 @@ <methodparam><type>bool</type><parameter>mode</parameter></methodparam> </methodsynopsis> <para> -&warn.undocumented.func; + <function>mysqli_autocommmit</function> is used to turn on or off auto-commit mode + on queries for the database connection represented by the <parameter>link</parameter> + resource. The <function>mysqli_autocommit</function> will return a boolean indicating + success or failure of the call. </para> </refsect1> </refentry> Index: phpdoc/en/reference/mysqli/functions/mysqli-change-user.xml diff -u phpdoc/en/reference/mysqli/functions/mysqli-change-user.xml:1.1 phpdoc/en/reference/mysqli/functions/mysqli-change-user.xml:1.2 --- phpdoc/en/reference/mysqli/functions/mysqli-change-user.xml:1.1 Sat Mar 15 18:01:33 2003 +++ phpdoc/en/reference/mysqli/functions/mysqli-change-user.xml Tue May 13 19:12:15 2003 @@ -1,9 +1,9 @@ <?xml version="1.0" encoding="iso-8859-1"?> -<!-- $Revision: 1.1 $ --> +<!-- $Revision: 1.2 $ --> <refentry id="function.mysqli-change-user"> <refnamediv> <refname>mysqli_change_user</refname> - <refpurpose></refpurpose> + <refpurpose>Changes the user of the specified database connection</refpurpose> </refnamediv> <refsect1> <title>Description</title> @@ -15,8 +15,31 @@ <methodparam><type>string</type><parameter>database</parameter></methodparam> </methodsynopsis> <para> -&warn.undocumented.func; + <function>mysqli_change_user</function> is used to change the user of the specified + database connection as given by the <parameter>link</parameter> parameter and sets the + current database to that specified by the <parameter>database</parameter> parameter. + This function will return a boolean value indicating if the operation was successful + or not. </para> + <para> + If desired, the NULL value may be passed in place of the <parameter>database</parameter> + parameter resulting in only changing the user and not selecting a database. To select + a database in this case use the <function>mysqli_select_db</function> function. + </para> + <para> + In order to successfully change users a valid <parameter>username</parameter> and + <parameter>password</parameter> parameters must be provided and that user must have + sufficient permissions to access the desired database. If for any reason authorization + fails, the current user authentication will remain. + </para> + <note> + <para> + Using this command will always cause the current database connection to behave as if + was a completely new database connection, regardless of if the operation was completed + successfully. This reset includes performing a rollback on any active transactions, + closing all temporary tables, and unlocking all locked tables. + </para> + </note> </refsect1> </refentry> Index: phpdoc/en/reference/mysqli/functions/mysqli-character-set-name.xml diff -u phpdoc/en/reference/mysqli/functions/mysqli-character-set-name.xml:1.1 phpdoc/en/reference/mysqli/functions/mysqli-character-set-name.xml:1.2 --- phpdoc/en/reference/mysqli/functions/mysqli-character-set-name.xml:1.1 Sat Mar 15 18:01:33 2003 +++ phpdoc/en/reference/mysqli/functions/mysqli-character-set-name.xml Tue May 13 19:12:16 2003 @@ -1,9 +1,9 @@ <?xml version="1.0" encoding="iso-8859-1"?> -<!-- $Revision: 1.1 $ --> +<!-- $Revision: 1.2 $ --> <refentry id="function.mysqli-character-set-name"> <refnamediv> <refname>mysqli_character_set_name</refname> - <refpurpose></refpurpose> + <refpurpose>Returns the default character set for the database connection</refpurpose> </refnamediv> <refsect1> <title>Description</title> @@ -12,7 +12,8 @@ <methodparam><type>resource</type><parameter>link</parameter></methodparam> </methodsynopsis> <para> -&warn.undocumented.func; + Returns the current character set for the database connection specified by the + <parameter>link</parameter> parameter. </para> </refsect1> </refentry> Index: phpdoc/en/reference/mysqli/functions/mysqli-close.xml diff -u phpdoc/en/reference/mysqli/functions/mysqli-close.xml:1.1 phpdoc/en/reference/mysqli/functions/mysqli-close.xml:1.2 --- phpdoc/en/reference/mysqli/functions/mysqli-close.xml:1.1 Sat Mar 15 18:01:33 2003 +++ phpdoc/en/reference/mysqli/functions/mysqli-close.xml Tue May 13 19:12:16 2003 @@ -1,9 +1,9 @@ <?xml version="1.0" encoding="iso-8859-1"?> -<!-- $Revision: 1.1 $ --> +<!-- $Revision: 1.2 $ --> <refentry id="function.mysqli-close"> <refnamediv> <refname>mysqli_close</refname> - <refpurpose>close connection</refpurpose> + <refpurpose>Closes a previously opened database connection</refpurpose> </refnamediv> <refsect1> <title>Description</title> @@ -12,7 +12,8 @@ <methodparam><type>resource</type><parameter>link</parameter></methodparam> </methodsynopsis> <para> -&warn.undocumented.func; + The <function>mysqli_close</function> function closes a previously opened database + connection specified by the <parameter>link</parameter> parameter. </para> </refsect1> </refentry> Index: phpdoc/en/reference/mysqli/functions/mysqli-commit.xml diff -u phpdoc/en/reference/mysqli/functions/mysqli-commit.xml:1.1 phpdoc/en/reference/mysqli/functions/mysqli-commit.xml:1.2 --- phpdoc/en/reference/mysqli/functions/mysqli-commit.xml:1.1 Sat Mar 15 18:01:33 2003 +++ phpdoc/en/reference/mysqli/functions/mysqli-commit.xml Tue May 13 19:12:16 2003 @@ -1,9 +1,9 @@ <?xml version="1.0" encoding="iso-8859-1"?> -<!-- $Revision: 1.1 $ --> +<!-- $Revision: 1.2 $ --> <refentry id="function.mysqli-commit"> <refnamediv> <refname>mysqli_commit</refname> - <refpurpose></refpurpose> + <refpurpose>Commits the current transaction</refpurpose> </refnamediv> <refsect1> <title>Description</title> @@ -12,7 +12,12 @@ <methodparam><type>resource</type><parameter>link</parameter></methodparam> </methodsynopsis> <para> -&warn.undocumented.func; + Commits the current transaction for the database specified by the + <parameter>link</parameter> parameter. + </para> + <para> + See also: <function>mysqli_autocommit</function>, + <function>mysqli_rollback</function>. </para> </refsect1> </refentry> Index: phpdoc/en/reference/mysqli/functions/mysqli-connect.xml diff -u phpdoc/en/reference/mysqli/functions/mysqli-connect.xml:1.1 phpdoc/en/reference/mysqli/functions/mysqli-connect.xml:1.2 --- phpdoc/en/reference/mysqli/functions/mysqli-connect.xml:1.1 Sat Mar 15 18:01:33 2003 +++ phpdoc/en/reference/mysqli/functions/mysqli-connect.xml Tue May 13 19:12:16 2003 @@ -1,9 +1,9 @@ <?xml version="1.0" encoding="iso-8859-1"?> -<!-- $Revision: 1.1 $ --> +<!-- $Revision: 1.2 $ --> <refentry id="function.mysqli-connect"> <refnamediv> <refname>mysqli_connect</refname> - <refpurpose>open a connection to a mysql server</refpurpose> + <refpurpose>Open a new connection to the MySQL server</refpurpose> </refnamediv> <refsect1> <title>Description</title> @@ -17,8 +17,37 @@ <methodparam choice='opt'><type>string</type><parameter>socket</parameter></methodparam> </methodsynopsis> <para> -&warn.undocumented.func; + The <function>mysqli_connect</function> attempts to open a connection to the MySQL Server running + on <parameter>host</parameter> which can be either a hostname or an IP address. Passing the NULL + value or the string "localhost" to this parameter, the local host is assumed. When possible, pipes + will be used instead of the TCP/IP protocol. If successful, the <function>mysqli_connect</function> + will return a resource representing the connection to the database, or FALSE on failure. </para> + <para> + The <parameter>username</parameter> and <parameter>password</parameter> parameters specify the + username and password under which to connect to the MySQL server. If the password is not provided + (the NULL value is passed), the MySQL server will attempt to authenticate the user against those + user records which have no password only. This allows one username to be used with different + permissions (depending on if a password as provided or not). + </para> + <para> + The <parameter>dbname</parameter> parameter if provided will specify the default database to be + used when performing queries. + </para> + <para> + The <parameter>port</parameter> and <parameter>socket</parameter> parameters are used in + conjunction with the <parameter>hostname</parameter> parameter to further control how to connect + to the database server. The <parameter>port</parameter> parameter specifies the port number to + attempt to connect to the MySQL server on, while the <parameter>socket</parameter> parameter + specifies the socket or named pipe that should be used. + </para> + <note> + <para> + Specifying the <parameter>socket</parameter> parameter will not explicitly determine the type + of connection to be used when connecting to the MySQL server. How the connection is made to the + MySQL database is determined by the <parameter>host</parameter> parameter. + </para> + </note> </refsect1> </refentry> Index: phpdoc/en/reference/mysqli/functions/mysqli-data-seek.xml diff -u phpdoc/en/reference/mysqli/functions/mysqli-data-seek.xml:1.1 phpdoc/en/reference/mysqli/functions/mysqli-data-seek.xml:1.2 --- phpdoc/en/reference/mysqli/functions/mysqli-data-seek.xml:1.1 Sat Mar 15 18:01:33 2003 +++ phpdoc/en/reference/mysqli/functions/mysqli-data-seek.xml Tue May 13 19:12:16 2003 @@ -1,19 +1,29 @@ <?xml version="1.0" encoding="iso-8859-1"?> -<!-- $Revision: 1.1 $ --> +<!-- $Revision: 1.2 $ --> <refentry id="function.mysqli-data-seek"> <refnamediv> <refname>mysqli_data_seek</refname> - <refpurpose></refpurpose> + <refpurpose>Adjusts the result pointer to an arbitary row in the result</refpurpose> </refnamediv> <refsect1> <title>Description</title> <methodsynopsis> <type>void</type><methodname>mysqli_data_seek</methodname> <methodparam><type>resource</type><parameter>result</parameter></methodparam> + <methodparam><type>int</type><parameter>offset</parameter></methodparam> </methodsynopsis> <para> -&warn.undocumented.func; + The <function>mysqli_data_seek</function> function seeks to an arbitrary result pointer + specified by the <parameter>offset</parameter> in the result set represented by + <parameter>result</parameter>. The <parameter>offset</parameter> parameter must be between + zero and the total number of rows minus one (<function>0..mysqli_num_rows</function> - 1). </para> + <note> + <para> + This function can only be used with results attained from the use of the + <function>mysqli_store_result</function> function. + </para> + </note> </refsect1> </refentry> Index: phpdoc/en/reference/mysqli/functions/mysqli-debug.xml diff -u phpdoc/en/reference/mysqli/functions/mysqli-debug.xml:1.1 phpdoc/en/reference/mysqli/functions/mysqli-debug.xml:1.2 --- phpdoc/en/reference/mysqli/functions/mysqli-debug.xml:1.1 Sat Mar 15 18:01:33 2003 +++ phpdoc/en/reference/mysqli/functions/mysqli-debug.xml Tue May 13 19:12:16 2003 @@ -1,9 +1,9 @@ <?xml version="1.0" encoding="iso-8859-1"?> -<!-- $Revision: 1.1 $ --> +<!-- $Revision: 1.2 $ --> <refentry id="function.mysqli-debug"> <refnamediv> <refname>mysqli_debug</refname> - <refpurpose></refpurpose> + <refpurpose>Performs debugging operations</refpurpose> </refnamediv> <refsect1> <title>Description</title> @@ -12,7 +12,24 @@ <methodparam><type>string</type><parameter>debug</parameter></methodparam> </methodsynopsis> <para> -&warn.undocumented.func; + The <function>mysqli_debug</function> function is used to perform debugging + operations using the Fred Fish debugging library. The <parameter>debug</parameter> + parameter is a string representing the debugging operation to perform. + </para> + <para> + <example> + <title>Generating a Trace File</title> + <programlisting role="php"> +<![CDATA[ +<?php + + /* Create a trace file in '/tmp/client.trace' on the local (client) machine: */ + mysqli_debug("d:t:0,/tmp/client.trace"); + +?> +]]> + </programlisting> + </example> </para> </refsect1> </refentry> Index: phpdoc/en/reference/mysqli/functions/mysqli-dump-debug-info.xml diff -u phpdoc/en/reference/mysqli/functions/mysqli-dump-debug-info.xml:1.1 phpdoc/en/reference/mysqli/functions/mysqli-dump-debug-info.xml:1.2 --- phpdoc/en/reference/mysqli/functions/mysqli-dump-debug-info.xml:1.1 Sat Mar 15 18:01:33 2003 +++ phpdoc/en/reference/mysqli/functions/mysqli-dump-debug-info.xml Tue May 13 19:12:16 2003 @@ -1,9 +1,9 @@ <?xml version="1.0" encoding="iso-8859-1"?> -<!-- $Revision: 1.1 $ --> +<!-- $Revision: 1.2 $ --> <refentry id="function.mysqli-dump-debug-info"> <refnamediv> <refname>mysqli_dump_debug_info</refname> - <refpurpose></refpurpose> + <refpurpose>Dump debugging information into the log</refpurpose> </refnamediv> <refsect1> <title>Description</title> @@ -12,7 +12,11 @@ <methodparam><type>resource</type><parameter>link</parameter></methodparam> </methodsynopsis> <para> -&warn.undocumented.func; + This function is designed to be executed by a user with the SUPER privledge and + is used to dump debugging information into the log for the MySQL Server relating + to the connection specified by the <parameter>link</parameter> parameter. When + executed <function>mysqli_dump_debug_info</function> will return a boolean + indicating the success or failure of the dump. </para> </refsect1> </refentry> Index: phpdoc/en/reference/mysqli/functions/mysqli-errno.xml diff -u phpdoc/en/reference/mysqli/functions/mysqli-errno.xml:1.1 phpdoc/en/reference/mysqli/functions/mysqli-errno.xml:1.2 --- phpdoc/en/reference/mysqli/functions/mysqli-errno.xml:1.1 Sat Mar 15 18:01:33 2003 +++ phpdoc/en/reference/mysqli/functions/mysqli-errno.xml Tue May 13 19:12:16 2003 @@ -1,9 +1,9 @@ <?xml version="1.0" encoding="iso-8859-1"?> -<!-- $Revision: 1.1 $ --> +<!-- $Revision: 1.2 $ --> <refentry id="function.mysqli-errno"> <refnamediv> <refname>mysqli_errno</refname> - <refpurpose></refpurpose> + <refpurpose>Returns the error code for the most recent function call</refpurpose> </refnamediv> <refsect1> <title>Description</title> @@ -12,8 +12,17 @@ <methodparam><type>resource</type><parameter>link</parameter></methodparam> </methodsynopsis> <para> -&warn.undocumented.func; + The <function>mysqli_errno</function> function will return the last error code for + the most recent MySQLi function call that can succeed or fail with respect to the + database link defined by the <parameter>link</parameter> parameter. If no errors + have occured, this function will return zero. </para> + <note> + <para> + A complete list of the error codes and their meanings can be found in the constants + section of the MySQLi documentation + </para> + </note> </refsect1> </refentry> Index: phpdoc/en/reference/mysqli/functions/mysqli-error.xml diff -u phpdoc/en/reference/mysqli/functions/mysqli-error.xml:1.1 phpdoc/en/reference/mysqli/functions/mysqli-error.xml:1.2 --- phpdoc/en/reference/mysqli/functions/mysqli-error.xml:1.1 Fri Apr 25 18:01:11 2003 +++ phpdoc/en/reference/mysqli/functions/mysqli-error.xml Tue May 13 19:12:16 2003 @@ -1,9 +1,9 @@ <?xml version="1.0" encoding="iso-8859-1"?> -<!-- $Revision: 1.1 $ --> +<!-- $Revision: 1.2 $ --> <refentry id="function.mysqli-error"> <refnamediv> <refname>mysqli_error</refname> - <refpurpose></refpurpose> + <refpurpose>Returns a string description of the last error</refpurpose> </refnamediv> <refsect1> <title>Description</title> @@ -12,7 +12,12 @@ <methodparam><type>resource</type><parameter>link</parameter></methodparam> </methodsynopsis> <para> -&warn.undocumented.func; + The <function>mysqli_error</function> is identical to the corresponding + <function>mysqli_errno</function> function in every way, except instead of returning + an integer error code the <function>mysqli_error</function> function will return + a string representation of the last error to occur for the database connection + represented by the <parameter>link</parameter> parameter. If no error has occured, + this function will return an empty string. </para> </refsect1> </refentry> Index: phpdoc/en/reference/mysqli/functions/mysqli-execute.xml diff -u phpdoc/en/reference/mysqli/functions/mysqli-execute.xml:1.1 phpdoc/en/reference/mysqli/functions/mysqli-execute.xml:1.2 --- phpdoc/en/reference/mysqli/functions/mysqli-execute.xml:1.1 Sat Mar 15 18:01:33 2003 +++ phpdoc/en/reference/mysqli/functions/mysqli-execute.xml Tue May 13 19:12:16 2003 @@ -1,9 +1,9 @@ <?xml version="1.0" encoding="iso-8859-1"?> -<!-- $Revision: 1.1 $ --> +<!-- $Revision: 1.2 $ --> <refentry id="function.mysqli-execute"> <refnamediv> <refname>mysqli_execute</refname> - <refpurpose></refpurpose> + <refpurpose>Executes a prepared Query</refpurpose> </refnamediv> <refsect1> <title>Description</title> @@ -12,7 +12,59 @@ <methodparam><type>resource</type><parameter>stmt</parameter></methodparam> </methodsynopsis> <para> -&warn.undocumented.func; + The <function>mysqli_execute</function> function executes a query that has been previously + prepared using the <function>mysqli_prepare</function> function represented by the + <parameter>stmt</parameter> resource. When executed any parameter markers which exist will + automatically be replaced with the appropiate data. + </para> + <para> + If the statement is UPDATE, DELETE, or INSERT, the total number of affected rows can be + determined by using the <function>mysqli_stmt_affected_rows</function> function. Likewise, + if the query yields a result set the <function>mysqli_fetch</function> function is used. + </para> + <note> + <para> + When using <function>mysqli_execute</function>, the <function>mysqli_fetch</function> + function must be used to fetch the data prior to preforming any additional queries. + </para> + </note> + <para> + <example> + <title>Using the mysqli_execute function</title> + <programlisting role="php"> +<![CDATA[ +<?php + + /* Open a connection */ + $link = mysqli_connect("localhost", "user", "pass"); + /* Turn on autocommit */ + mysqli_autocommit($link, true); + + /* Prepare an insert statement */ + $query = "INSERT INTO foo VALUES(?, ?)"; + $stmt = mysqli_prepare($link, $query); + + $value_one = "hello"; + $value_two = "world"; + + mysqli_bind_param($link, $value_one, $value_two); + + /* Execute the statement */ + mysqli_execute($stmt); + + /* Return the affected rows for the statement */ + $affected_rows = mysqli_stmt_affected_rows($stmt); + + /* Close the statement */ + + mysqli_stmt_close($stmt); + + echo "The total affected rows was $affected_rows"; + +?> +]]> + </programlisting> + </example> </para> </refsect1> </refentry> Index: phpdoc/en/reference/mysqli/functions/mysqli-fetch-array.xml diff -u phpdoc/en/reference/mysqli/functions/mysqli-fetch-array.xml:1.1 phpdoc/en/reference/mysqli/functions/mysqli-fetch-array.xml:1.2 --- phpdoc/en/reference/mysqli/functions/mysqli-fetch-array.xml:1.1 Sat Mar 15 18:01:33 2003 +++ phpdoc/en/reference/mysqli/functions/mysqli-fetch-array.xml Tue May 13 19:12:16 2003 @@ -1,9 +1,9 @@ <?xml version="1.0" encoding="iso-8859-1"?> -<!-- $Revision: 1.1 $ --> +<!-- $Revision: 1.2 $ --> <refentry id="function.mysqli-fetch-array"> <refnamediv> <refname>mysqli_fetch_array</refname> - <refpurpose></refpurpose> + <refpurpose>Fetch a result row as an associative, a numeric array, or both.</refpurpose> </refnamediv> <refsect1> <title>Description</title> @@ -13,8 +13,92 @@ <methodparam choice='opt'><type>int</type><parameter>resulttype</parameter></methodparam> </methodsynopsis> <para> -&warn.undocumented.func; + Returns an array that corresponds to the fetched row or FALSE if there are no more rows for the + database connection represented by the <parameter>link</parameter> parameter. </para> + <para> + <function>mysqli_fetch_array</function> is an extended version of the + <function>mysqli_fetch_row</function> function. In addition to storing the data in the + numeric indices of the result array, the <function>mysqli_fetch_array</function> function can + also store the data in associative indices, using the field names of the result set as keys. + </para> + <para> + If two or more columns of the result have the same field names, the last column will take + precedence and overwrite the earlier data. In order to access multiple columns with the same + name, the numerically indexed version of the row must be used. + </para> + <para> + The optional second argument <parameter>result_type</parameter> is a constant indicating what + type of array should be produced from the current row data. The possible values for this parameter + are the constants MYSQLI_ASSOC, MYSQLI_NUM, or MYSQLI_BOTH. By default the + <function>mysqli_fetch_array</function> function will assume MYSQLI_BOTH for this parameter. + </para> + <para> + By using the MYSQLI_ASSOC constant this function will behave identically to the + <function>mysqli_fetch_assoc</function>, while MYSQLI_NUM will behave identically to the + <function>mysqli_fetch_row</function> function. The final option MYSQLI_BOTH will create a single + array with the attributes of both. + </para> + <example> + <title>mysqli_fetch_array with MYSQLI_NUM</title> + <programlisting role="php"> +<![CDATA[ +<?php + mysqli_connect("localhost", "mysql_user", "mysql_password") or + die("Could not connect: " . mysqli_error()); + mysqli_select_db("mydb"); + + $result = mysqli_query("SELECT id, name FROM mytable"); + + while ($row = mysqli_fetch_array($result, MYSQL_NUM)) { + printf ("ID: %s Name: %s", $row[0], $row[1]); + } + + mysqli_free_result($result); +?> +]]> + </programlisting> + </example> + <example> + <title>mysql_fetch_array with MYSQL_ASSOC</title> + <programlisting role="php"> +<![CDATA[ +<?php + mysqli_connect("localhost", "mysql_user", "mysql_password") or + die("Could not connect: " . mysqli_error()); + mysqli_select_db("mydb"); + + $result = mysqli_query("SELECT id, name FROM mytable"); + + while ($row = mysqli_fetch_array($result, MYSQL_ASSOC)) { + printf ("ID: %s Name: %s", $row["id"], $row["name"]); + } + + mysqli_free_result($result); +?> +]]> + </programlisting> + </example> + <example> + <title>mysql_fetch_array with MYSQL_BOTH</title> + <programlisting role="php"> +<![CDATA[ +<?php + mysqli_connect("localhost", "mysql_user", "mysql_password") or + die("Could not connect: " . mysqli_error()); + mysqli_select_db("mydb"); + + $result = mysqli_query("SELECT id, name FROM mytable"); + + while ($row = mysqli_fetch_array($result, MYSQL_BOTH)) { + printf ("ID: %s Name: %s", $row[0], $row["name"]); + } + + mysqli_free_result($result); +?> +]]> + </programlisting> + </example> </refsect1> </refentry> Index: phpdoc/en/reference/mysqli/functions/mysqli-fetch-assoc.xml diff -u phpdoc/en/reference/mysqli/functions/mysqli-fetch-assoc.xml:1.1 phpdoc/en/reference/mysqli/functions/mysqli-fetch-assoc.xml:1.2 --- phpdoc/en/reference/mysqli/functions/mysqli-fetch-assoc.xml:1.1 Sat Mar 15 18:01:33 2003 +++ phpdoc/en/reference/mysqli/functions/mysqli-fetch-assoc.xml Tue May 13 19:12:16 2003 @@ -1,9 +1,9 @@ <?xml version="1.0" encoding="iso-8859-1"?> -<!-- $Revision: 1.1 $ --> +<!-- $Revision: 1.2 $ --> <refentry id="function.mysqli-fetch-assoc"> <refnamediv> <refname>mysqli_fetch_assoc</refname> - <refpurpose></refpurpose> + <refpurpose>Fetch a result row as an associative array</refpurpose> </refnamediv> <refsect1> <title>Description</title> @@ -12,8 +12,72 @@ <methodparam><type>resource</type><parameter>result</parameter></methodparam> </methodsynopsis> <para> -&warn.undocumented.func; + Returns an associative array that corresponds to the fetched row or FALSE if there are no + more rows. </para> + <para> + The <function>mysqli_fetch_assoc</function> function is used to return an associative array + representing the next row in the result set for the result represented by the + <parameter>result</parameter> parameter, where each key in the array represents the name + of one of the result set's columns. + </para> + <para> + If two or more columns in the result set have the same column name, the associative array + returned by the <function>mysqli_fetch_assoc</function> function will contain the value of + the last column of that name. If you must work with result sets with this properity, the + <function>mysqli_fetch_row</function> should be used which returns an numerically-indexed + array instead. + </para> + <example> + <title>An expanded <function>mysqli_fetch_assoc</function> example</title> + <programlisting role="php"> +<![CDATA[ +<?php + + $conn = mysqli_connect("localhost", "mysql_user", "mysql_password"); + + if (!$conn) { + echo "Unable to connect to DB: " . mysqli_error(); + exit; + } + + if (!mysqli_select_db("mydbname")) { + echo "Unable to select mydbname: " . mysqli_error(); + exit; + } + + $sql = "SELECT id as userid, fullname, userstatus + FROM sometable + WHERE userstatus = 1"; + + $result = mysqli_query($sql); + + if (!$result) { + echo "Could not successfully run query ($sql) from DB: " . mysqli_error(); + exit; + } + + if (mysqli_num_rows($result) == 0) { + echo "No rows found, nothing to print so am exiting"; + exit; + } + + // While a row of data exists, put that row in $row as an associative array + // Note: If you're expecting just one row, no need to use a loop + // Note: If you put extract($row); inside the following loop, you'll + // then create $userid, $fullname, and $userstatus + while ($row = mysqli_fetch_assoc($result)) { + echo $row["userid"]; + echo $row["fullname"]; + echo $row["userstatus"]; + } + + mysqli_free_result($result); + +?> +]]> + </programlisting> + </example> </refsect1> </refentry> Index: phpdoc/en/reference/mysqli/functions/mysqli-fetch-field.xml diff -u phpdoc/en/reference/mysqli/functions/mysqli-fetch-field.xml:1.1 phpdoc/en/reference/mysqli/functions/mysqli-fetch-field.xml:1.2 --- phpdoc/en/reference/mysqli/functions/mysqli-fetch-field.xml:1.1 Fri Apr 25 18:01:11 2003 +++ phpdoc/en/reference/mysqli/functions/mysqli-fetch-field.xml Tue May 13 19:12:16 2003 @@ -1,9 +1,9 @@ <?xml version="1.0" encoding="iso-8859-1"?> -<!-- $Revision: 1.1 $ --> +<!-- $Revision: 1.2 $ --> <refentry id="function.mysqli-fetch-field"> <refnamediv> <refname>mysqli_fetch_field</refname> - <refpurpose></refpurpose> + <refpurpose>Return the next field in the result set</refpurpose> </refnamediv> <refsect1> <title>Description</title> @@ -12,7 +12,62 @@ <methodparam><type>resource</type><parameter>result</parameter></methodparam> </methodsynopsis> <para> -&warn.undocumented.func; + The <function>mysqli_fetch_field</function> function is used to return the attributes + of the next column in the result set represented by the <parameter>result</parameter> + parameter as an object. When executed this function will return an object containing + the attributes of the current column or &false; if there are no more columns in the + result set. + </para> + <para> + <table> + <title>Object attributes</title> + <tgroup cols='2'> + <thead> + <row> + <entry>Attribute</entry> + <entry>Description</entry> + </row> + </thead> + <tbody> + <row> + <entry>name</entry> + <entry>The name of the column</entry> + </row> + <row> + <entry>orgname</entry> + <entry>?</entry> + </row> + <row> + <entry>table</entry> + <entry>The name of the table this field belongs to (if not calculated)</entry> + </row> + <row> + <entry>orgtable</entry> + <entry>?</entry> + </row> + <row> + <entry>def</entry> + <entry>The default value for this field, represented as a string</entry> + </row> + <row> + <entry>max_length</entry> + <entry>The maximum width of the field for the result set.</entry> + </row> + <row> + <entry>flags</entry> + <entry>An integer representing the bit-flags for the field.</entry> + </row> + <row> + <entry>type</entry> + <entry>The data type used for this field</entry> + </row> + <row> + <entry>decimals</entry> + <entry>The number of decimals used (for integer fields)</entry> + </row> + </tbody> + </tgroup> + </table> </para> </refsect1> </refentry> Index: phpdoc/en/reference/mysqli/functions/mysqli-fetch-fields.xml diff -u phpdoc/en/reference/mysqli/functions/mysqli-fetch-fields.xml:1.1 phpdoc/en/reference/mysqli/functions/mysqli-fetch-fields.xml:1.2 --- phpdoc/en/reference/mysqli/functions/mysqli-fetch-fields.xml:1.1 Fri Apr 25 18:01:11 2003 +++ phpdoc/en/reference/mysqli/functions/mysqli-fetch-fields.xml Tue May 13 19:12:16 2003 @@ -1,9 +1,9 @@ <?xml version="1.0" encoding="iso-8859-1"?> -<!-- $Revision: 1.1 $ --> +<!-- $Revision: 1.2 $ --> <refentry id="function.mysqli-fetch-fields"> <refnamediv> <refname>mysqli_fetch_fields</refname> - <refpurpose></refpurpose> + <refpurpose>Return an array of objects representing the fields in a result set</refpurpose> </refnamediv> <refsect1> <title>Description</title> @@ -12,7 +12,11 @@ <methodparam><type>resource</type><parameter>result</parameter></methodparam> </methodsynopsis> <para> -&warn.undocumented.func; + This function serves an identical purpose to the <function>mysqli_fetch_field</function> + function with the single difference that, instead of returning one object at a time for + each field, the columns are returned as an array of objects. For a description of the + attributes of each object and their meaning, see the <function>mysqli_fetch_field</function> + function. </para> </refsect1> </refentry> Index: phpdoc/en/reference/mysqli/functions/mysqli-fetch-lengths.xml diff -u phpdoc/en/reference/mysqli/functions/mysqli-fetch-lengths.xml:1.1 phpdoc/en/reference/mysqli/functions/mysqli-fetch-lengths.xml:1.2 --- phpdoc/en/reference/mysqli/functions/mysqli-fetch-lengths.xml:1.1 Sat Mar 15 18:01:33 2003 +++ phpdoc/en/reference/mysqli/functions/mysqli-fetch-lengths.xml Tue May 13 19:12:16 2003 @@ -1,9 +1,9 @@ <?xml version="1.0" encoding="iso-8859-1"?> -<!-- $Revision: 1.1 $ --> +<!-- $Revision: 1.2 $ --> <refentry id="function.mysqli-fetch-lengths"> <refnamediv> <refname>mysqli_fetch_lengths</refname> - <refpurpose></refpurpose> + <refpurpose>Returns the lengths of the columns of the current row in the result set</refpurpose> </refnamediv> <refsect1> <title>Description</title> @@ -12,7 +12,10 @@ <methodparam><type>resource</type><parameter>result</parameter></methodparam> </methodsynopsis> <para> -&warn.undocumented.func; + The <function>mysqli_fetch_lengths</function> function returns an array containing the + lengths of every column of the current row within the result set represented by the + <parameter>result</parameter> parameter. If succesfully, an numerically indexed array + representing the lengths of each column is returned or &false; on failure. </para> </refsect1> </refentry> Index: phpdoc/en/reference/mysqli/functions/mysqli-fetch-object.xml diff -u phpdoc/en/reference/mysqli/functions/mysqli-fetch-object.xml:1.1 phpdoc/en/reference/mysqli/functions/mysqli-fetch-object.xml:1.2 --- phpdoc/en/reference/mysqli/functions/mysqli-fetch-object.xml:1.1 Sat Mar 15 18:01:33 2003 +++ phpdoc/en/reference/mysqli/functions/mysqli-fetch-object.xml Tue May 13 19:12:16 2003 @@ -1,9 +1,9 @@ <?xml version="1.0" encoding="iso-8859-1"?> -<!-- $Revision: 1.1 $ --> +<!-- $Revision: 1.2 $ --> <refentry id="function.mysqli-fetch-object"> <refnamediv> <refname>mysqli_fetch_object</refname> - <refpurpose></refpurpose> + <refpurpose>Return the current row of a result set as an object</refpurpose> </refnamediv> <refsect1> <title>Description</title> @@ -12,7 +12,9 @@ <methodparam><type>resource</type><parameter>result</parameter></methodparam> </methodsynopsis> <para> -&warn.undocumented.func; + The <function>mysqli_fetch_object</function> will return the current row result set + as an object where the attributes of the object rerpesent the names of the fields found + within the result set. If no more rows exist in the current result set, &false; is returned. </para> </refsect1> </refentry> Index: phpdoc/en/reference/mysqli/functions/mysqli-fetch-row.xml diff -u phpdoc/en/reference/mysqli/functions/mysqli-fetch-row.xml:1.1 phpdoc/en/reference/mysqli/functions/mysqli-fetch-row.xml:1.2 --- phpdoc/en/reference/mysqli/functions/mysqli-fetch-row.xml:1.1 Sat Mar 15 18:01:33 2003 +++ phpdoc/en/reference/mysqli/functions/mysqli-fetch-row.xml Tue May 13 19:12:16 2003 @@ -1,9 +1,9 @@ <?xml version="1.0" encoding="iso-8859-1"?> -<!-- $Revision: 1.1 $ --> +<!-- $Revision: 1.2 $ --> <refentry id="function.mysqli-fetch-row"> <refnamediv> <refname>mysqli_fetch_row</refname> - <refpurpose></refpurpose> + <refpurpose>Get a result row as an enumerated array</refpurpose> </refnamediv> <refsect1> <title>Description</title> @@ -12,7 +12,14 @@ <methodparam><type>resource</type><parameter>result</parameter></methodparam> </methodsynopsis> <para> -&warn.undocumented.func; + Returns an array that corresponds to the fetched row, or &false; if there are no more rows. + </para> + <para> + <function>mysqli_fetch_row</function> fetches one row of data from the result set represented by + <parameter>result</parameter> and returns it as an enumerated array, where each column is stored + in an array offset starting from 0 (zero). Each subsequent call to the + <function>mysqli_fetch_row</function> function will return the next row within the result set, + or &false; if there are no more rows. </para> </refsect1> </refentry>
Index: phpdoc/en/reference/mysqli/functions/mysqli-affected-rows.xml diff -u phpdoc/en/reference/mysqli/functions/mysqli-affected-rows.xml:1.1 phpdoc/en/reference/mysqli/functions/mysqli-affected-rows.xml:1.2 --- phpdoc/en/reference/mysqli/functions/mysqli-affected-rows.xml:1.1 Sat Mar 15 18:01:33 2003 +++ phpdoc/en/reference/mysqli/functions/mysqli-affected-rows.xml Tue May 13 19:12:15 2003 @@ -1,9 +1,9 @@ <?xml version="1.0" encoding="iso-8859-1"?> -<!-- $Revision: 1.1 $ --> +<!-- $Revision: 1.2 $ --> <refentry id="function.mysqli-affected-rows"> <refnamediv> <refname>mysqli_affected_rows</refname> - <refpurpose></refpurpose> + <refpurpose>Get the number of affected rows in a previous MySQL operation</refpurpose> </refnamediv> <refsect1> <title>Description</title> @@ -12,7 +12,75 @@ <methodparam><type>resource</type><parameter>link</parameter></methodparam> </methodsynopsis> <para> -&warn.undocumented.func; + <function>mysqli_affected_rows</function> returns the number of rows affected by the last + INSERT, UPDATE, or DELETE query associated with the provided <parameter>link</parameter> + parameter. If the last query was invalid, this function will return -1. + </para> + <note> + <para> + When deleting the entire contents of a table (i.e. 'DELETE FROM foo'), this function will + not return the number of rows that were actually deleted. + </para> + </note> + <para> + The <function>mysqli_affected_rows</function> function only works with queries which modify + a table. In order to return the number of rows from a SELECT query, use the + <function>mysqli_num_rows()</function> function instead. + </para> + <para> + <example> + <title>Delete-Query</title> + <programlisting role="php"> +<![CDATA[ +<?php + /* connect to database */ + mysqli_connect("localhost", "mysql_user", "mysql_password") or + die("Could not connect: " . mysqli_error()); + + /* this should return the correct numbers of deleted records */ + mysqli_query("DELETE FROM mytable WHERE id < 10"); + printf ("Records deleted: %d\n", mysqli_affected_rows()); + + /* without a where clause in a delete statement, it should return 0 */ + mysqli_query("DELETE FROM mytable"); + printf ("Records deleted: %d\n", mysqli_affected_rows()); +?> +]]> + </programlisting> + <para> + The above example would produce the following output: + <screen> +<![CDATA[ +Records deleted: 10 +Records deleted: 0 +]]> + </screen> + </para> + </example> + <example> + <title>Update-Query</title> + <programlisting role="php"> +<![CDATA[ +<?php + /* connect to database */ + mysqli_connect("localhost", "mysql_user", "mysql_password") or + die("Could not connect: " . mysql_error()); + + /* Update records */ + mysqli_query("UPDATE mytable SET used=1 WHERE id < 10"); + printf ("Updated records: %d\n", mysqli_affected_rows()); +?> +]]> + </programlisting> + <para> + The above example would produce the following output: + <screen> +<![CDATA[ +Updated Records: 10 +]]> + </screen> + </para> + </example> </para> </refsect1> </refentry> Index: phpdoc/en/reference/mysqli/functions/mysqli-autocommit.xml diff -u phpdoc/en/reference/mysqli/functions/mysqli-autocommit.xml:1.1 phpdoc/en/reference/mysqli/functions/mysqli-autocommit.xml:1.2 --- phpdoc/en/reference/mysqli/functions/mysqli-autocommit.xml:1.1 Sat Mar 15 18:01:33 2003 +++ phpdoc/en/reference/mysqli/functions/mysqli-autocommit.xml Tue May 13 19:12:15 2003 @@ -1,9 +1,9 @@ <?xml version="1.0" encoding="iso-8859-1"?> -<!-- $Revision: 1.1 $ --> +<!-- $Revision: 1.2 $ --> <refentry id="function.mysqli-autocommit"> <refnamediv> <refname>mysqli_autocommit</refname> - <refpurpose></refpurpose> + <refpurpose>Turns on and off auto-commiting database modifications</refpurpose> </refnamediv> <refsect1> <title>Description</title> @@ -13,7 +13,10 @@ <methodparam><type>bool</type><parameter>mode</parameter></methodparam> </methodsynopsis> <para> -&warn.undocumented.func; + <function>mysqli_autocommmit</function> is used to turn on or off auto-commit mode + on queries for the database connection represented by the <parameter>link</parameter> + resource. The <function>mysqli_autocommit</function> will return a boolean indicating + success or failure of the call. </para> </refsect1> </refentry> Index: phpdoc/en/reference/mysqli/functions/mysqli-change-user.xml diff -u phpdoc/en/reference/mysqli/functions/mysqli-change-user.xml:1.1 phpdoc/en/reference/mysqli/functions/mysqli-change-user.xml:1.2 --- phpdoc/en/reference/mysqli/functions/mysqli-change-user.xml:1.1 Sat Mar 15 18:01:33 2003 +++ phpdoc/en/reference/mysqli/functions/mysqli-change-user.xml Tue May 13 19:12:15 2003 @@ -1,9 +1,9 @@ <?xml version="1.0" encoding="iso-8859-1"?> -<!-- $Revision: 1.1 $ --> +<!-- $Revision: 1.2 $ --> <refentry id="function.mysqli-change-user"> <refnamediv> <refname>mysqli_change_user</refname> - <refpurpose></refpurpose> + <refpurpose>Changes the user of the specified database connection</refpurpose> </refnamediv> <refsect1> <title>Description</title> @@ -15,8 +15,31 @@ <methodparam><type>string</type><parameter>database</parameter></methodparam> </methodsynopsis> <para> -&warn.undocumented.func; + <function>mysqli_change_user</function> is used to change the user of the specified + database connection as given by the <parameter>link</parameter> parameter and sets the + current database to that specified by the <parameter>database</parameter> parameter. + This function will return a boolean value indicating if the operation was successful + or not. </para> + <para> + If desired, the NULL value may be passed in place of the <parameter>database</parameter> + parameter resulting in only changing the user and not selecting a database. To select + a database in this case use the <function>mysqli_select_db</function> function. + </para> + <para> + In order to successfully change users a valid <parameter>username</parameter> and + <parameter>password</parameter> parameters must be provided and that user must have + sufficient permissions to access the desired database. If for any reason authorization + fails, the current user authentication will remain. + </para> + <note> + <para> + Using this command will always cause the current database connection to behave as if + was a completely new database connection, regardless of if the operation was completed + successfully. This reset includes performing a rollback on any active transactions, + closing all temporary tables, and unlocking all locked tables. + </para> + </note> </refsect1> </refentry> Index: phpdoc/en/reference/mysqli/functions/mysqli-character-set-name.xml diff -u phpdoc/en/reference/mysqli/functions/mysqli-character-set-name.xml:1.1 phpdoc/en/reference/mysqli/functions/mysqli-character-set-name.xml:1.2 --- phpdoc/en/reference/mysqli/functions/mysqli-character-set-name.xml:1.1 Sat Mar 15 18:01:33 2003 +++ phpdoc/en/reference/mysqli/functions/mysqli-character-set-name.xml Tue May 13 19:12:16 2003 @@ -1,9 +1,9 @@ <?xml version="1.0" encoding="iso-8859-1"?> -<!-- $Revision: 1.1 $ --> +<!-- $Revision: 1.2 $ --> <refentry id="function.mysqli-character-set-name"> <refnamediv> <refname>mysqli_character_set_name</refname> - <refpurpose></refpurpose> + <refpurpose>Returns the default character set for the database connection</refpurpose> </refnamediv> <refsect1> <title>Description</title> @@ -12,7 +12,8 @@ <methodparam><type>resource</type><parameter>link</parameter></methodparam> </methodsynopsis> <para> -&warn.undocumented.func; + Returns the current character set for the database connection specified by the + <parameter>link</parameter> parameter. </para> </refsect1> </refentry> Index: phpdoc/en/reference/mysqli/functions/mysqli-close.xml diff -u phpdoc/en/reference/mysqli/functions/mysqli-close.xml:1.1 phpdoc/en/reference/mysqli/functions/mysqli-close.xml:1.2 --- phpdoc/en/reference/mysqli/functions/mysqli-close.xml:1.1 Sat Mar 15 18:01:33 2003 +++ phpdoc/en/reference/mysqli/functions/mysqli-close.xml Tue May 13 19:12:16 2003 @@ -1,9 +1,9 @@ <?xml version="1.0" encoding="iso-8859-1"?> -<!-- $Revision: 1.1 $ --> +<!-- $Revision: 1.2 $ --> <refentry id="function.mysqli-close"> <refnamediv> <refname>mysqli_close</refname> - <refpurpose>close connection</refpurpose> + <refpurpose>Closes a previously opened database connection</refpurpose> </refnamediv> <refsect1> <title>Description</title> @@ -12,7 +12,8 @@ <methodparam><type>resource</type><parameter>link</parameter></methodparam> </methodsynopsis> <para> -&warn.undocumented.func; + The <function>mysqli_close</function> function closes a previously opened database + connection specified by the <parameter>link</parameter> parameter. </para> </refsect1> </refentry> Index: phpdoc/en/reference/mysqli/functions/mysqli-commit.xml diff -u phpdoc/en/reference/mysqli/functions/mysqli-commit.xml:1.1 phpdoc/en/reference/mysqli/functions/mysqli-commit.xml:1.2 --- phpdoc/en/reference/mysqli/functions/mysqli-commit.xml:1.1 Sat Mar 15 18:01:33 2003 +++ phpdoc/en/reference/mysqli/functions/mysqli-commit.xml Tue May 13 19:12:16 2003 @@ -1,9 +1,9 @@ <?xml version="1.0" encoding="iso-8859-1"?> -<!-- $Revision: 1.1 $ --> +<!-- $Revision: 1.2 $ --> <refentry id="function.mysqli-commit"> <refnamediv> <refname>mysqli_commit</refname> - <refpurpose></refpurpose> + <refpurpose>Commits the current transaction</refpurpose> </refnamediv> <refsect1> <title>Description</title> @@ -12,7 +12,12 @@ <methodparam><type>resource</type><parameter>link</parameter></methodparam> </methodsynopsis> <para> -&warn.undocumented.func; + Commits the current transaction for the database specified by the + <parameter>link</parameter> parameter. + </para> + <para> + See also: <function>mysqli_autocommit</function>, + <function>mysqli_rollback</function>. </para> </refsect1> </refentry> Index: phpdoc/en/reference/mysqli/functions/mysqli-connect.xml diff -u phpdoc/en/reference/mysqli/functions/mysqli-connect.xml:1.1 phpdoc/en/reference/mysqli/functions/mysqli-connect.xml:1.2 --- phpdoc/en/reference/mysqli/functions/mysqli-connect.xml:1.1 Sat Mar 15 18:01:33 2003 +++ phpdoc/en/reference/mysqli/functions/mysqli-connect.xml Tue May 13 19:12:16 2003 @@ -1,9 +1,9 @@ <?xml version="1.0" encoding="iso-8859-1"?> -<!-- $Revision: 1.1 $ --> +<!-- $Revision: 1.2 $ --> <refentry id="function.mysqli-connect"> <refnamediv> <refname>mysqli_connect</refname> - <refpurpose>open a connection to a mysql server</refpurpose> + <refpurpose>Open a new connection to the MySQL server</refpurpose> </refnamediv> <refsect1> <title>Description</title> @@ -17,8 +17,37 @@ <methodparam choice='opt'><type>string</type><parameter>socket</parameter></methodparam> </methodsynopsis> <para> -&warn.undocumented.func; + The <function>mysqli_connect</function> attempts to open a connection to the MySQL Server running + on <parameter>host</parameter> which can be either a hostname or an IP address. Passing the NULL + value or the string "localhost" to this parameter, the local host is assumed. When possible, pipes + will be used instead of the TCP/IP protocol. If successful, the <function>mysqli_connect</function> + will return a resource representing the connection to the database, or FALSE on failure. </para> + <para> + The <parameter>username</parameter> and <parameter>password</parameter> parameters specify the + username and password under which to connect to the MySQL server. If the password is not provided + (the NULL value is passed), the MySQL server will attempt to authenticate the user against those + user records which have no password only. This allows one username to be used with different + permissions (depending on if a password as provided or not). + </para> + <para> + The <parameter>dbname</parameter> parameter if provided will specify the default database to be + used when performing queries. + </para> + <para> + The <parameter>port</parameter> and <parameter>socket</parameter> parameters are used in + conjunction with the <parameter>hostname</parameter> parameter to further control how to connect + to the database server. The <parameter>port</parameter> parameter specifies the port number to + attempt to connect to the MySQL server on, while the <parameter>socket</parameter> parameter + specifies the socket or named pipe that should be used. + </para> + <note> + <para> + Specifying the <parameter>socket</parameter> parameter will not explicitly determine the type + of connection to be used when connecting to the MySQL server. How the connection is made to the + MySQL database is determined by the <parameter>host</parameter> parameter. + </para> + </note> </refsect1> </refentry> Index: phpdoc/en/reference/mysqli/functions/mysqli-data-seek.xml diff -u phpdoc/en/reference/mysqli/functions/mysqli-data-seek.xml:1.1 phpdoc/en/reference/mysqli/functions/mysqli-data-seek.xml:1.2 --- phpdoc/en/reference/mysqli/functions/mysqli-data-seek.xml:1.1 Sat Mar 15 18:01:33 2003 +++ phpdoc/en/reference/mysqli/functions/mysqli-data-seek.xml Tue May 13 19:12:16 2003 @@ -1,19 +1,29 @@ <?xml version="1.0" encoding="iso-8859-1"?> -<!-- $Revision: 1.1 $ --> +<!-- $Revision: 1.2 $ --> <refentry id="function.mysqli-data-seek"> <refnamediv> <refname>mysqli_data_seek</refname> - <refpurpose></refpurpose> + <refpurpose>Adjusts the result pointer to an arbitary row in the result</refpurpose> </refnamediv> <refsect1> <title>Description</title> <methodsynopsis> <type>void</type><methodname>mysqli_data_seek</methodname> <methodparam><type>resource</type><parameter>result</parameter></methodparam> + <methodparam><type>int</type><parameter>offset</parameter></methodparam> </methodsynopsis> <para> -&warn.undocumented.func; + The <function>mysqli_data_seek</function> function seeks to an arbitrary result pointer + specified by the <parameter>offset</parameter> in the result set represented by + <parameter>result</parameter>. The <parameter>offset</parameter> parameter must be between + zero and the total number of rows minus one (<function>0..mysqli_num_rows</function> - 1). </para> + <note> + <para> + This function can only be used with results attained from the use of the + <function>mysqli_store_result</function> function. + </para> + </note> </refsect1> </refentry> Index: phpdoc/en/reference/mysqli/functions/mysqli-debug.xml diff -u phpdoc/en/reference/mysqli/functions/mysqli-debug.xml:1.1 phpdoc/en/reference/mysqli/functions/mysqli-debug.xml:1.2 --- phpdoc/en/reference/mysqli/functions/mysqli-debug.xml:1.1 Sat Mar 15 18:01:33 2003 +++ phpdoc/en/reference/mysqli/functions/mysqli-debug.xml Tue May 13 19:12:16 2003 @@ -1,9 +1,9 @@ <?xml version="1.0" encoding="iso-8859-1"?> -<!-- $Revision: 1.1 $ --> +<!-- $Revision: 1.2 $ --> <refentry id="function.mysqli-debug"> <refnamediv> <refname>mysqli_debug</refname> - <refpurpose></refpurpose> + <refpurpose>Performs debugging operations</refpurpose> </refnamediv> <refsect1> <title>Description</title> @@ -12,7 +12,24 @@ <methodparam><type>string</type><parameter>debug</parameter></methodparam> </methodsynopsis> <para> -&warn.undocumented.func; + The <function>mysqli_debug</function> function is used to perform debugging + operations using the Fred Fish debugging library. The <parameter>debug</parameter> + parameter is a string representing the debugging operation to perform. + </para> + <para> + <example> + <title>Generating a Trace File</title> + <programlisting role="php"> +<![CDATA[ +<?php + + /* Create a trace file in '/tmp/client.trace' on the local (client) machine: */ + mysqli_debug("d:t:0,/tmp/client.trace"); + +?> +]]> + </programlisting> + </example> </para> </refsect1> </refentry> Index: phpdoc/en/reference/mysqli/functions/mysqli-dump-debug-info.xml diff -u phpdoc/en/reference/mysqli/functions/mysqli-dump-debug-info.xml:1.1 phpdoc/en/reference/mysqli/functions/mysqli-dump-debug-info.xml:1.2 --- phpdoc/en/reference/mysqli/functions/mysqli-dump-debug-info.xml:1.1 Sat Mar 15 18:01:33 2003 +++ phpdoc/en/reference/mysqli/functions/mysqli-dump-debug-info.xml Tue May 13 19:12:16 2003 @@ -1,9 +1,9 @@ <?xml version="1.0" encoding="iso-8859-1"?> -<!-- $Revision: 1.1 $ --> +<!-- $Revision: 1.2 $ --> <refentry id="function.mysqli-dump-debug-info"> <refnamediv> <refname>mysqli_dump_debug_info</refname> - <refpurpose></refpurpose> + <refpurpose>Dump debugging information into the log</refpurpose> </refnamediv> <refsect1> <title>Description</title> @@ -12,7 +12,11 @@ <methodparam><type>resource</type><parameter>link</parameter></methodparam> </methodsynopsis> <para> -&warn.undocumented.func; + This function is designed to be executed by a user with the SUPER privledge and + is used to dump debugging information into the log for the MySQL Server relating + to the connection specified by the <parameter>link</parameter> parameter. When + executed <function>mysqli_dump_debug_info</function> will return a boolean + indicating the success or failure of the dump. </para> </refsect1> </refentry> Index: phpdoc/en/reference/mysqli/functions/mysqli-errno.xml diff -u phpdoc/en/reference/mysqli/functions/mysqli-errno.xml:1.1 phpdoc/en/reference/mysqli/functions/mysqli-errno.xml:1.2 --- phpdoc/en/reference/mysqli/functions/mysqli-errno.xml:1.1 Sat Mar 15 18:01:33 2003 +++ phpdoc/en/reference/mysqli/functions/mysqli-errno.xml Tue May 13 19:12:16 2003 @@ -1,9 +1,9 @@ <?xml version="1.0" encoding="iso-8859-1"?> -<!-- $Revision: 1.1 $ --> +<!-- $Revision: 1.2 $ --> <refentry id="function.mysqli-errno"> <refnamediv> <refname>mysqli_errno</refname> - <refpurpose></refpurpose> + <refpurpose>Returns the error code for the most recent function call</refpurpose> </refnamediv> <refsect1> <title>Description</title> @@ -12,8 +12,17 @@ <methodparam><type>resource</type><parameter>link</parameter></methodparam> </methodsynopsis> <para> -&warn.undocumented.func; + The <function>mysqli_errno</function> function will return the last error code for + the most recent MySQLi function call that can succeed or fail with respect to the + database link defined by the <parameter>link</parameter> parameter. If no errors + have occured, this function will return zero. </para> + <note> + <para> + A complete list of the error codes and their meanings can be found in the constants + section of the MySQLi documentation + </para> + </note> </refsect1> </refentry> Index: phpdoc/en/reference/mysqli/functions/mysqli-error.xml diff -u phpdoc/en/reference/mysqli/functions/mysqli-error.xml:1.1 phpdoc/en/reference/mysqli/functions/mysqli-error.xml:1.2 --- phpdoc/en/reference/mysqli/functions/mysqli-error.xml:1.1 Fri Apr 25 18:01:11 2003 +++ phpdoc/en/reference/mysqli/functions/mysqli-error.xml Tue May 13 19:12:16 2003 @@ -1,9 +1,9 @@ <?xml version="1.0" encoding="iso-8859-1"?> -<!-- $Revision: 1.1 $ --> +<!-- $Revision: 1.2 $ --> <refentry id="function.mysqli-error"> <refnamediv> <refname>mysqli_error</refname> - <refpurpose></refpurpose> + <refpurpose>Returns a string description of the last error</refpurpose> </refnamediv> <refsect1> <title>Description</title> @@ -12,7 +12,12 @@ <methodparam><type>resource</type><parameter>link</parameter></methodparam> </methodsynopsis> <para> -&warn.undocumented.func; + The <function>mysqli_error</function> is identical to the corresponding + <function>mysqli_errno</function> function in every way, except instead of returning + an integer error code the <function>mysqli_error</function> function will return + a string representation of the last error to occur for the database connection + represented by the <parameter>link</parameter> parameter. If no error has occured, + this function will return an empty string. </para> </refsect1> </refentry> Index: phpdoc/en/reference/mysqli/functions/mysqli-execute.xml diff -u phpdoc/en/reference/mysqli/functions/mysqli-execute.xml:1.1 phpdoc/en/reference/mysqli/functions/mysqli-execute.xml:1.2 --- phpdoc/en/reference/mysqli/functions/mysqli-execute.xml:1.1 Sat Mar 15 18:01:33 2003 +++ phpdoc/en/reference/mysqli/functions/mysqli-execute.xml Tue May 13 19:12:16 2003 @@ -1,9 +1,9 @@ <?xml version="1.0" encoding="iso-8859-1"?> -<!-- $Revision: 1.1 $ --> +<!-- $Revision: 1.2 $ --> <refentry id="function.mysqli-execute"> <refnamediv> <refname>mysqli_execute</refname> - <refpurpose></refpurpose> + <refpurpose>Executes a prepared Query</refpurpose> </refnamediv> <refsect1> <title>Description</title> @@ -12,7 +12,59 @@ <methodparam><type>resource</type><parameter>stmt</parameter></methodparam> </methodsynopsis> <para> -&warn.undocumented.func; + The <function>mysqli_execute</function> function executes a query that has been previously + prepared using the <function>mysqli_prepare</function> function represented by the + <parameter>stmt</parameter> resource. When executed any parameter markers which exist will + automatically be replaced with the appropiate data. + </para> + <para> + If the statement is UPDATE, DELETE, or INSERT, the total number of affected rows can be + determined by using the <function>mysqli_stmt_affected_rows</function> function. Likewise, + if the query yields a result set the <function>mysqli_fetch</function> function is used. + </para> + <note> + <para> + When using <function>mysqli_execute</function>, the <function>mysqli_fetch</function> + function must be used to fetch the data prior to preforming any additional queries. + </para> + </note> + <para> + <example> + <title>Using the mysqli_execute function</title> + <programlisting role="php"> +<![CDATA[ +<?php + + /* Open a connection */ + $link = mysqli_connect("localhost", "user", "pass"); + /* Turn on autocommit */ + mysqli_autocommit($link, true); + + /* Prepare an insert statement */ + $query = "INSERT INTO foo VALUES(?, ?)"; + $stmt = mysqli_prepare($link, $query); + + $value_one = "hello"; + $value_two = "world"; + + mysqli_bind_param($link, $value_one, $value_two); + + /* Execute the statement */ + mysqli_execute($stmt); + + /* Return the affected rows for the statement */ + $affected_rows = mysqli_stmt_affected_rows($stmt); + + /* Close the statement */ + + mysqli_stmt_close($stmt); + + echo "The total affected rows was $affected_rows"; + +?> +]]> + </programlisting> + </example> </para> </refsect1> </refentry> Index: phpdoc/en/reference/mysqli/functions/mysqli-fetch-array.xml diff -u phpdoc/en/reference/mysqli/functions/mysqli-fetch-array.xml:1.1 phpdoc/en/reference/mysqli/functions/mysqli-fetch-array.xml:1.2 --- phpdoc/en/reference/mysqli/functions/mysqli-fetch-array.xml:1.1 Sat Mar 15 18:01:33 2003 +++ phpdoc/en/reference/mysqli/functions/mysqli-fetch-array.xml Tue May 13 19:12:16 2003 @@ -1,9 +1,9 @@ <?xml version="1.0" encoding="iso-8859-1"?> -<!-- $Revision: 1.1 $ --> +<!-- $Revision: 1.2 $ --> <refentry id="function.mysqli-fetch-array"> <refnamediv> <refname>mysqli_fetch_array</refname> - <refpurpose></refpurpose> + <refpurpose>Fetch a result row as an associative, a numeric array, or both.</refpurpose> </refnamediv> <refsect1> <title>Description</title> @@ -13,8 +13,92 @@ <methodparam choice='opt'><type>int</type><parameter>resulttype</parameter></methodparam> </methodsynopsis> <para> -&warn.undocumented.func; + Returns an array that corresponds to the fetched row or FALSE if there are no more rows for the + database connection represented by the <parameter>link</parameter> parameter. </para> + <para> + <function>mysqli_fetch_array</function> is an extended version of the + <function>mysqli_fetch_row</function> function. In addition to storing the data in the + numeric indices of the result array, the <function>mysqli_fetch_array</function> function can + also store the data in associative indices, using the field names of the result set as keys. + </para> + <para> + If two or more columns of the result have the same field names, the last column will take + precedence and overwrite the earlier data. In order to access multiple columns with the same + name, the numerically indexed version of the row must be used. + </para> + <para> + The optional second argument <parameter>result_type</parameter> is a constant indicating what + type of array should be produced from the current row data. The possible values for this parameter + are the constants MYSQLI_ASSOC, MYSQLI_NUM, or MYSQLI_BOTH. By default the + <function>mysqli_fetch_array</function> function will assume MYSQLI_BOTH for this parameter. + </para> + <para> + By using the MYSQLI_ASSOC constant this function will behave identically to the + <function>mysqli_fetch_assoc</function>, while MYSQLI_NUM will behave identically to the + <function>mysqli_fetch_row</function> function. The final option MYSQLI_BOTH will create a single + array with the attributes of both. + </para> + <example> + <title>mysqli_fetch_array with MYSQLI_NUM</title> + <programlisting role="php"> +<![CDATA[ +<?php + mysqli_connect("localhost", "mysql_user", "mysql_password") or + die("Could not connect: " . mysqli_error()); + mysqli_select_db("mydb"); + + $result = mysqli_query("SELECT id, name FROM mytable"); + + while ($row = mysqli_fetch_array($result, MYSQL_NUM)) { + printf ("ID: %s Name: %s", $row[0], $row[1]); + } + + mysqli_free_result($result); +?> +]]> + </programlisting> + </example> + <example> + <title>mysql_fetch_array with MYSQL_ASSOC</title> + <programlisting role="php"> +<![CDATA[ +<?php + mysqli_connect("localhost", "mysql_user", "mysql_password") or + die("Could not connect: " . mysqli_error()); + mysqli_select_db("mydb"); + + $result = mysqli_query("SELECT id, name FROM mytable"); + + while ($row = mysqli_fetch_array($result, MYSQL_ASSOC)) { + printf ("ID: %s Name: %s", $row["id"], $row["name"]); + } + + mysqli_free_result($result); +?> +]]> + </programlisting> + </example> + <example> + <title>mysql_fetch_array with MYSQL_BOTH</title> + <programlisting role="php"> +<![CDATA[ +<?php + mysqli_connect("localhost", "mysql_user", "mysql_password") or + die("Could not connect: " . mysqli_error()); + mysqli_select_db("mydb"); + + $result = mysqli_query("SELECT id, name FROM mytable"); + + while ($row = mysqli_fetch_array($result, MYSQL_BOTH)) { + printf ("ID: %s Name: %s", $row[0], $row["name"]); + } + + mysqli_free_result($result); +?> +]]> + </programlisting> + </example> </refsect1> </refentry> Index: phpdoc/en/reference/mysqli/functions/mysqli-fetch-assoc.xml diff -u phpdoc/en/reference/mysqli/functions/mysqli-fetch-assoc.xml:1.1 phpdoc/en/reference/mysqli/functions/mysqli-fetch-assoc.xml:1.2 --- phpdoc/en/reference/mysqli/functions/mysqli-fetch-assoc.xml:1.1 Sat Mar 15 18:01:33 2003 +++ phpdoc/en/reference/mysqli/functions/mysqli-fetch-assoc.xml Tue May 13 19:12:16 2003 @@ -1,9 +1,9 @@ <?xml version="1.0" encoding="iso-8859-1"?> -<!-- $Revision: 1.1 $ --> +<!-- $Revision: 1.2 $ --> <refentry id="function.mysqli-fetch-assoc"> <refnamediv> <refname>mysqli_fetch_assoc</refname> - <refpurpose></refpurpose> + <refpurpose>Fetch a result row as an associative array</refpurpose> </refnamediv> <refsect1> <title>Description</title> @@ -12,8 +12,72 @@ <methodparam><type>resource</type><parameter>result</parameter></methodparam> </methodsynopsis> <para> -&warn.undocumented.func; + Returns an associative array that corresponds to the fetched row or FALSE if there are no + more rows. </para> + <para> + The <function>mysqli_fetch_assoc</function> function is used to return an associative array + representing the next row in the result set for the result represented by the + <parameter>result</parameter> parameter, where each key in the array represents the name + of one of the result set's columns. + </para> + <para> + If two or more columns in the result set have the same column name, the associative array + returned by the <function>mysqli_fetch_assoc</function> function will contain the value of + the last column of that name. If you must work with result sets with this properity, the + <function>mysqli_fetch_row</function> should be used which returns an numerically-indexed + array instead. + </para> + <example> + <title>An expanded <function>mysqli_fetch_assoc</function> example</title> + <programlisting role="php"> +<![CDATA[ +<?php + + $conn = mysqli_connect("localhost", "mysql_user", "mysql_password"); + + if (!$conn) { + echo "Unable to connect to DB: " . mysqli_error(); + exit; + } + + if (!mysqli_select_db("mydbname")) { + echo "Unable to select mydbname: " . mysqli_error(); + exit; + } + + $sql = "SELECT id as userid, fullname, userstatus + FROM sometable + WHERE userstatus = 1"; + + $result = mysqli_query($sql); + + if (!$result) { + echo "Could not successfully run query ($sql) from DB: " . mysqli_error(); + exit; + } + + if (mysqli_num_rows($result) == 0) { + echo "No rows found, nothing to print so am exiting"; + exit; + } + + // While a row of data exists, put that row in $row as an associative array + // Note: If you're expecting just one row, no need to use a loop + // Note: If you put extract($row); inside the following loop, you'll + // then create $userid, $fullname, and $userstatus + while ($row = mysqli_fetch_assoc($result)) { + echo $row["userid"]; + echo $row["fullname"]; + echo $row["userstatus"]; + } + + mysqli_free_result($result); + +?> +]]> + </programlisting> + </example> </refsect1> </refentry> Index: phpdoc/en/reference/mysqli/functions/mysqli-fetch-field.xml diff -u phpdoc/en/reference/mysqli/functions/mysqli-fetch-field.xml:1.1 phpdoc/en/reference/mysqli/functions/mysqli-fetch-field.xml:1.2 --- phpdoc/en/reference/mysqli/functions/mysqli-fetch-field.xml:1.1 Fri Apr 25 18:01:11 2003 +++ phpdoc/en/reference/mysqli/functions/mysqli-fetch-field.xml Tue May 13 19:12:16 2003 @@ -1,9 +1,9 @@ <?xml version="1.0" encoding="iso-8859-1"?> -<!-- $Revision: 1.1 $ --> +<!-- $Revision: 1.2 $ --> <refentry id="function.mysqli-fetch-field"> <refnamediv> <refname>mysqli_fetch_field</refname> - <refpurpose></refpurpose> + <refpurpose>Return the next field in the result set</refpurpose> </refnamediv> <refsect1> <title>Description</title> @@ -12,7 +12,62 @@ <methodparam><type>resource</type><parameter>result</parameter></methodparam> </methodsynopsis> <para> -&warn.undocumented.func; + The <function>mysqli_fetch_field</function> function is used to return the attributes + of the next column in the result set represented by the <parameter>result</parameter> + parameter as an object. When executed this function will return an object containing + the attributes of the current column or &false; if there are no more columns in the + result set. + </para> + <para> + <table> + <title>Object attributes</title> + <tgroup cols='2'> + <thead> + <row> + <entry>Attribute</entry> + <entry>Description</entry> + </row> + </thead> + <tbody> + <row> + <entry>name</entry> + <entry>The name of the column</entry> + </row> + <row> + <entry>orgname</entry> + <entry>?</entry> + </row> + <row> + <entry>table</entry> + <entry>The name of the table this field belongs to (if not calculated)</entry> + </row> + <row> + <entry>orgtable</entry> + <entry>?</entry> + </row> + <row> + <entry>def</entry> + <entry>The default value for this field, represented as a string</entry> + </row> + <row> + <entry>max_length</entry> + <entry>The maximum width of the field for the result set.</entry> + </row> + <row> + <entry>flags</entry> + <entry>An integer representing the bit-flags for the field.</entry> + </row> + <row> + <entry>type</entry> + <entry>The data type used for this field</entry> + </row> + <row> + <entry>decimals</entry> + <entry>The number of decimals used (for integer fields)</entry> + </row> + </tbody> + </tgroup> + </table> </para> </refsect1> </refentry> Index: phpdoc/en/reference/mysqli/functions/mysqli-fetch-fields.xml diff -u phpdoc/en/reference/mysqli/functions/mysqli-fetch-fields.xml:1.1 phpdoc/en/reference/mysqli/functions/mysqli-fetch-fields.xml:1.2 --- phpdoc/en/reference/mysqli/functions/mysqli-fetch-fields.xml:1.1 Fri Apr 25 18:01:11 2003 +++ phpdoc/en/reference/mysqli/functions/mysqli-fetch-fields.xml Tue May 13 19:12:16 2003 @@ -1,9 +1,9 @@ <?xml version="1.0" encoding="iso-8859-1"?> -<!-- $Revision: 1.1 $ --> +<!-- $Revision: 1.2 $ --> <refentry id="function.mysqli-fetch-fields"> <refnamediv> <refname>mysqli_fetch_fields</refname> - <refpurpose></refpurpose> + <refpurpose>Return an array of objects representing the fields in a result set</refpurpose> </refnamediv> <refsect1> <title>Description</title> @@ -12,7 +12,11 @@ <methodparam><type>resource</type><parameter>result</parameter></methodparam> </methodsynopsis> <para> -&warn.undocumented.func; + This function serves an identical purpose to the <function>mysqli_fetch_field</function> + function with the single difference that, instead of returning one object at a time for + each field, the columns are returned as an array of objects. For a description of the + attributes of each object and their meaning, see the <function>mysqli_fetch_field</function> + function. </para> </refsect1> </refentry> Index: phpdoc/en/reference/mysqli/functions/mysqli-fetch-lengths.xml diff -u phpdoc/en/reference/mysqli/functions/mysqli-fetch-lengths.xml:1.1 phpdoc/en/reference/mysqli/functions/mysqli-fetch-lengths.xml:1.2 --- phpdoc/en/reference/mysqli/functions/mysqli-fetch-lengths.xml:1.1 Sat Mar 15 18:01:33 2003 +++ phpdoc/en/reference/mysqli/functions/mysqli-fetch-lengths.xml Tue May 13 19:12:16 2003 @@ -1,9 +1,9 @@ <?xml version="1.0" encoding="iso-8859-1"?> -<!-- $Revision: 1.1 $ --> +<!-- $Revision: 1.2 $ --> <refentry id="function.mysqli-fetch-lengths"> <refnamediv> <refname>mysqli_fetch_lengths</refname> - <refpurpose></refpurpose> + <refpurpose>Returns the lengths of the columns of the current row in the result set</refpurpose> </refnamediv> <refsect1> <title>Description</title> @@ -12,7 +12,10 @@ <methodparam><type>resource</type><parameter>result</parameter></methodparam> </methodsynopsis> <para> -&warn.undocumented.func; + The <function>mysqli_fetch_lengths</function> function returns an array containing the + lengths of every column of the current row within the result set represented by the + <parameter>result</parameter> parameter. If succesfully, an numerically indexed array + representing the lengths of each column is returned or &false; on failure. </para> </refsect1> </refentry> Index: phpdoc/en/reference/mysqli/functions/mysqli-fetch-object.xml diff -u phpdoc/en/reference/mysqli/functions/mysqli-fetch-object.xml:1.1 phpdoc/en/reference/mysqli/functions/mysqli-fetch-object.xml:1.2 --- phpdoc/en/reference/mysqli/functions/mysqli-fetch-object.xml:1.1 Sat Mar 15 18:01:33 2003 +++ phpdoc/en/reference/mysqli/functions/mysqli-fetch-object.xml Tue May 13 19:12:16 2003 @@ -1,9 +1,9 @@ <?xml version="1.0" encoding="iso-8859-1"?> -<!-- $Revision: 1.1 $ --> +<!-- $Revision: 1.2 $ --> <refentry id="function.mysqli-fetch-object"> <refnamediv> <refname>mysqli_fetch_object</refname> - <refpurpose></refpurpose> + <refpurpose>Return the current row of a result set as an object</refpurpose> </refnamediv> <refsect1> <title>Description</title> @@ -12,7 +12,9 @@ <methodparam><type>resource</type><parameter>result</parameter></methodparam> </methodsynopsis> <para> -&warn.undocumented.func; + The <function>mysqli_fetch_object</function> will return the current row result set + as an object where the attributes of the object rerpesent the names of the fields found + within the result set. If no more rows exist in the current result set, &false; is returned. </para> </refsect1> </refentry> Index: phpdoc/en/reference/mysqli/functions/mysqli-fetch-row.xml diff -u phpdoc/en/reference/mysqli/functions/mysqli-fetch-row.xml:1.1 phpdoc/en/reference/mysqli/functions/mysqli-fetch-row.xml:1.2 --- phpdoc/en/reference/mysqli/functions/mysqli-fetch-row.xml:1.1 Sat Mar 15 18:01:33 2003 +++ phpdoc/en/reference/mysqli/functions/mysqli-fetch-row.xml Tue May 13 19:12:16 2003 @@ -1,9 +1,9 @@ <?xml version="1.0" encoding="iso-8859-1"?> -<!-- $Revision: 1.1 $ --> +<!-- $Revision: 1.2 $ --> <refentry id="function.mysqli-fetch-row"> <refnamediv> <refname>mysqli_fetch_row</refname> - <refpurpose></refpurpose> + <refpurpose>Get a result row as an enumerated array</refpurpose> </refnamediv> <refsect1> <title>Description</title> @@ -12,7 +12,14 @@ <methodparam><type>resource</type><parameter>result</parameter></methodparam> </methodsynopsis> <para> -&warn.undocumented.func; + Returns an array that corresponds to the fetched row, or &false; if there are no more rows. + </para> + <para> + <function>mysqli_fetch_row</function> fetches one row of data from the result set represented by + <parameter>result</parameter> and returns it as an enumerated array, where each column is stored + in an array offset starting from 0 (zero). Each subsequent call to the + <function>mysqli_fetch_row</function> function will return the next row within the result set, + or &false; if there are no more rows. </para> </refsect1> </refentry>