cvs: phpdoc /en/reference/mysqli/functions mysqli-bind-param.xml mysqli-bind-result.xml mysqli-execute.xml mysqli-fetch.xml mysqli-get-metadata.xml
mysqli-param-count.xml mysqli-prepare.xml mysqli-send-long-data.xml mysqli-stmt-affected-rows.xml mysqli-stmt-bind-param.xml
mysqli-stmt-bind-result.xml mysqli-stmt-close.xml mysqli-stmt-data-seek.xml mysqli-stmt-errno.xml mysqli-stmt-error.xml mysqli-stmt-execute.xml
mysqli-stmt-fetch.xml mysqli-stmt-init.xml mysqli-stmt-num-rows.xml mysqli-stmt-param-count.xml mysqli-stmt-prepare.xml
mysqli-stmt-result-metadata.xml mysqli-stmt-send-long-data.xml mysqli-stmt-sqlstate.xml mysqli-stmt-store-result.xml
| From: | Georg Richter | Date: | Tue, 09 Mar 2004 17:21:49 +0000 |
| Subject: | cvs: phpdoc /en/reference/mysqli/functions mysqli-bind-param.xml mysqli-bind-result.xml mysqli-execute.xml mysqli-fetch.xml mysqli-get-metadata.xml mysqli-param-count.xml mysqli-prepare.xml mysqli-send-long-data.xml mysqli-stmt-affected-rows.xml mysqli-stmt-bind-param.xml mysqli-stmt-bind-result.xml mysqli-stmt-close.xml mysqli-stmt-data-seek.xml mysqli-stmt-errno.xml mysqli-stmt-error.xml mysqli-stmt-execute.xml mysqli-stmt-fetch.xml mysqli-stmt-init.xml mysqli-stmt-num-rows.xml mysqli-stmt-param-count.xml mysqli-stmt-prepare.xml mysqli-stmt-result-metadata.xml mysqli-stmt-send-long-data.xml mysqli-stmt-sqlstate.xml mysqli-stmt-store-result.xml |
||
| Groups: | php.doc | ||
| Request: | Send a blank email to phpdoc+get-969359444@lists.php.net to get a copy of this message | ||
georg Tue Mar 9 12:21:49 2004 EDT
Added files:
/phpdoc/en/reference/mysqli/functions mysqli-stmt-bind-param.xml
mysqli-stmt-bind-result.xml
mysqli-stmt-execute.xml
mysqli-stmt-fetch.xml
mysqli-stmt-init.xml
mysqli-stmt-param-count.xml
mysqli-stmt-prepare.xml
mysqli-stmt-result-metadata.xml
mysqli-stmt-send-long-data.xml
Modified files:
/phpdoc/en/reference/mysqli/functions mysqli-bind-param.xml
mysqli-bind-result.xml
mysqli-execute.xml
mysqli-fetch.xml
mysqli-get-metadata.xml
mysqli-param-count.xml
mysqli-prepare.xml
mysqli-send-long-data.xml
mysqli-stmt-affected-rows.xml
mysqli-stmt-close.xml
mysqli-stmt-data-seek.xml
mysqli-stmt-errno.xml
mysqli-stmt-error.xml
mysqli-stmt-num-rows.xml
mysqli-stmt-sqlstate.xml
mysqli-stmt-store-result.xml
Log:
Documented renamed functions
changed/fixed samples
http://cvs.php.net/diff.php/phpdoc/en/reference/mysqli/functions/mysqli-bind-param.xml?r1=1.7&r2=1.8&ty=u Index: phpdoc/en/reference/mysqli/functions/mysqli-bind-param.xml diff -u phpdoc/en/reference/mysqli/functions/mysqli-bind-param.xml:1.7 phpdoc/en/reference/mysqli/functions/mysqli-bind-param.xml:1.8 --- phpdoc/en/reference/mysqli/functions/mysqli-bind-param.xml:1.7 Wed Feb 25 16:59:16 2004 +++ phpdoc/en/reference/mysqli/functions/mysqli-bind-param.xml Tue Mar 9 12:21:48 2004 @@ -1,189 +1,29 @@ <?xml version="1.0" encoding="iso-8859-1"?> -<!-- $Revision: 1.7 $ --> +<!-- $Revision: 1.8 $ --> <refentry id="function.mysqli-bind-param"> <refnamediv> <refname>mysqli_bind_param</refname> - <refname>stmt->bind_param</refname> - <refpurpose>Binds variables to a prepared statement as parameters</refpurpose> + <refpurpose>Alias for <function>mysqli_stmt_bind_param</function></refpurpose> </refnamediv> <refsect1> <title>Description</title> - <para>Procedural style:</para> - <methodsynopsis> - <type>bool</type><methodname>mysqli_bind_param</methodname> - <methodparam><type>object</type><parameter>stmt</parameter></methodparam> - <methodparam><type>string</type><parameter>types</parameter></methodparam> - <methodparam><type>mixed</type><parameter>var1</parameter></methodparam> - <methodparam choice="opt"><type>mixed</type><parameter>var2, ...</parameter></methodparam> - </methodsynopsis> - <para>Object oriented style (method):</para> - <classsynopsis> - <ooclass><classname>stmt</classname></ooclass> - <methodsynopsis> - <type>bool</type> - <methodname>bind_param</methodname> - <methodparam><type>array</type><parameter>types</parameter></methodparam> - <methodparam><type>mixed</type><parameter>var1</parameter></methodparam> - <methodparam choice="opt"><type>mixed</type><parameter>var2, ...</parameter></methodparam> - </methodsynopsis> - </classsynopsis> <para> - <function>mysql_bind_param</function> is used to bind variables for the - parameter markers in the SQL statement that was passed to - <function>mysql_prepare</function>. - The string <parameter>types</parameter> contains one or more characters which specify - the types for the corresponding bind variables - <table> - <title>Type specification chars</title> - <tgroup cols='2'> - <thead> - <row> - <entry>Character</entry> - <entry>Description</entry> - </row> - </thead> - <tbody> - <row> - <entry>i</entry> - <entry>corresponding variable has type integer</entry> - </row> - <row> - <entry>d</entry> - <entry>corresponding variable has type double</entry> - </row> - <row> - <entry>s</entry> - <entry>corresponding variable has type string</entry> - </row> - <row> - <entry>b</entry> - <entry>corresponding variable is a blob and will be send in packages</entry> - </row> - </tbody> - </tgroup> - </table> + This function is an alias of <function>mysqli_stmt_bind_param</function>. + For a detailled descripton see description of + <function>mysqli_stmt_bind_param</function>. </para> <note> - <para> - If data size of a variable exceeds max. allowed package size - (max_allowed_package), you have to specify <literal>b</literal> in - <parameter>types</parameter> and use - <function>mysqli_send_long_data</function> to send the data in packages. - </para> - <para> - The number of variables and length of - string <parameter>types</parameter> must match the parameters in the statement. + <para> + <function>mysqli_bind_param</function> is deprecated and will be removed. </para> </note> </refsect1> <refsect1> - <title>Return values</title> + <title>See also</title> <para> - &return.success; + <function>mysqli_stmt_bind_param</function> </para> </refsect1> - <refsect1> - <title>See also</title> - <para> - <function>mysqli_bind_result</function>, - <function>mysqli_execute</function>, - <function>mysqli_fetch</function>, - <function>mysqli_prepare</function>, - <function>mysqli_send_long_data</function>, - <function>mysqli_stmt_errno</function>, - <function>mysqli_stmt_error</function> - </para> - </refsect1> - <refsect1> - <title>Example</title> - <example> - <title>Object oriented style</title> - <programlisting role="php"> -<![CDATA[ -<?php -$mysqli = new mysqli('localhost', 'my_user', 'my_password', 'world'); - -/* check connection */ -if (mysqli_connect_errno()) { - printf("Connect failed: %s\n", mysqli_connect_error()); - exit(); -} - -$stmt = $mysqli->prepare("INSERT INTO CountryLanguage VALUES (?, ?, ?, ?)"); -$stmt->bind_param('sssd', $code, $language, $official, $percent); - -$code = 'DEU'; -$language = 'Bavarian'; -$official = "F"; -$percent = 11.2; - -/* execute prepared statement */ -$stmt->execute(); - -printf("%d Row inserted.\n", $stmt->affected_rows); - -/* close statement and connection */ -$stmt->close(); - -/* Clean up table CountryLanguage */ -$mysqli->query("DELETE FROM CountryLanguage WHERE Language='Bavarian'"); -printf("%d Row deleted.\n", $mysqli->affected_rows); - -/* close connection */ -$mysqli->close(); -?> -]]> - </programlisting> - </example> - <example> - <title>Procedural style</title> - <programlisting role="php"> -<![CDATA[ -<?php -$link = mysqli_connect('localhost', 'my_user', 'my_password', 'world'); - -/* check connection */ -if (!$link) { - printf("Connect failed: %s\n", mysqli_connect_error()); - exit(); -} - -$stmt = mysqli_prepare($link, "INSERT INTO CountryLanguage VALUES (?, ?, ?, ?)"); -mysqli_bind_param($stmt, 'sssd', $code, $language, $official, $percent); - -$code = 'DEU'; -$language = 'Bavarian'; -$official = "F"; -$percent = 11.2; - -/* execute prepared statement */ -mysqli_execute($stmt); - -printf("%d Row inserted.\n", mysqli_stmt_affected_rows($stmt)); - -/* close statement and connection */ -mysqli_stmt_close($stmt); - -/* Clean up table CountryLanguage */ -mysqli_query($link, "DELETE FROM CountryLanguage WHERE Language='Bavarian'"); -printf("%d Row deleted.\n", mysqli_affected_rows($link)); - -/* close connection */ -mysqli_close($link); -?> -]]> - </programlisting> - </example> - <para> - The above examples would produce the following output: - </para> - <screen> -<![CDATA[ -1 Row inserted. -1 Row deleted. -]]> - </screen> - </refsect1> </refentry> <!-- Keep this comment at the end of the file http://cvs.php.net/diff.php/phpdoc/en/reference/mysqli/functions/mysqli-bind-result.xml?r1=1.4&r2=1.5&ty=u Index: phpdoc/en/reference/mysqli/functions/mysqli-bind-result.xml diff -u phpdoc/en/reference/mysqli/functions/mysqli-bind-result.xml:1.4 phpdoc/en/reference/mysqli/functions/mysqli-bind-result.xml:1.5 --- phpdoc/en/reference/mysqli/functions/mysqli-bind-result.xml:1.4 Wed Feb 25 16:59:16 2004 +++ phpdoc/en/reference/mysqli/functions/mysqli-bind-result.xml Tue Mar 9 12:21:48 2004 @@ -1,148 +1,28 @@ <?xml version="1.0" encoding="iso-8859-1"?> -<!-- $Revision: 1.4 $ --> +<!-- $Revision: 1.5 $ --> <refentry id="function.mysqli-bind-result"> <refnamediv> <refname>mysqli_bind_result</refname> - <refname>stmt->bind_result</refname> - <refpurpose>Binds variables to a prepared statement for result storage</refpurpose> + <refpurpose>Alias for <function>mysqli_stmt_bind_result</function></refpurpose> </refnamediv> <refsect1> <title>Description</title> - <para>Procedural style:</para> - <methodsynopsis> - <type>bool</type><methodname>mysqli_bind_result</methodname> - <methodparam><type>object</type><parameter>stmt</parameter></methodparam> - <methodparam><type>mixed</type><parameter>var1</parameter></methodparam> - <methodparam choice="opt"><type>mixed</type><parameter>var2, ...</parameter></methodparam> - </methodsynopsis> - <para>Object oriented style (method):</para> - <classsynopsis> - <ooclass><classname>stmt</classname></ooclass> - <methodsynopsis> - <type>bool</type> - <methodname>bind_result</methodname> - <methodparam><type>mixed</type><parameter>var1</parameter></methodparam> - <methodparam choice="opt"><type>mixed</type><parameter>var2, ...</parameter></methodparam> - </methodsynopsis> - </classsynopsis> - <para> - <function>mysqli_bind_result</function> is used to associate (bind) columns in the result - set to variables. When <function>mysqli_fetch</function> is called to fetch data, the MySQL - client/server protocol places the data for the bound columns into the specified variables - <parameter>var1, ...</parameter>. - </para> - <note> - <para> - Note that all columns must be bound prior to calling <function>mysqli_fetch</function>. - Depending on column types bound variables can silently change to the corresponding PHP type. - </para> - <para> - A column can be bound or rebound at any time, even after a result set has been partially retrieved. - The new binding takes effect the next time <function>mysqli_fetch</function> is called. - </para> - </note> - </refsect1> - <refsect1> - <title>Return values</title> <para> - &return.success; + This function is an alias of <function>mysqli_stmt_bind_result</function>. + For a detailled descripton see description of + <function>mysqli_stmt_bind_result</function>. </para> + <note> + <para> + <function>mysqli_bind_result</function> is deprecated and will be removed. + </para> + </note> </refsect1> <refsect1> <title>See also</title> <para> - <function>mysqli_bind_param</function>, - <function>mysqli_execute</function>, - <function>mysqli_fetch</function>, -<!-- <function>mysqli_fetch_column</function> --> - <function>mysqli_prepare</function>, - <function>mysqli_stmt_errno</function>, - <function>mysqli_stmt_error</function> - </para> - </refsect1> - <refsect1> - <title>Example</title> - <example> - <title>Object oriented style</title> - <programlisting role="php"> -<![CDATA[ -<?php -$mysqli = new mysqli("localhost", "my_user", "my_password", "world"); - -if (mysqli_connect_errno()) { - printf("Connect failed: %s\n", mysqli_connect_error()); - exit(); -} - -/* prepare statement */ -if ($stmt = $mysqli->prepare("SELECT Code, Name FROM Country ORDER BY Name LIMIT 5")) { - $stmt->execute(); - - /* bind variables to prepared statement */ - $stmt->bind_result($col1, $col2); - - /* fetch values */ - while ($stmt->fetch()) { - printf("%s %s\n", $col1, $col2); - } - - /* close statement */ - $stmt->close(); -} -/* close connection */ -$mysqli->close(); - -?> -]]> - </programlisting> - </example> - <example> - <title>Procedural style</title> - <programlisting role="php"> -<![CDATA[ -<?php -$link = mysqli_connect("localhost", "my_user", "my_password", "world"); - -/* check connection */ -if (!$link) { - printf("Connect failed: %s\n", mysqli_connect_error()); - exit(); -} - -/* prepare statement */ -if ($stmt = mysqli_prepare($link, "SELECT Code, Name FROM Country ORDER BY Name LIMIT 5")) { - mysqli_execute($stmt); - - /* bind variables to prepared statement */ - mysqli_bind_result($stmt, $col1, $col2); - - /* fetch values */ - while (mysqli_fetch($stmt)) { - printf("%s %s\n", $col1, $col2); - } - - /* close statement */ - mysqli_stmt_close($stmt); -} - -/* close connection */ -mysqli_close($link); -?> -]]> - </programlisting> - </example> - <para> - The above examples would produce the following output: + <function>mysqli_stmt_bind_result</function> </para> - <screen> -<![CDATA[ -AFG Afghanistan -ALB Albania -DZA Algeria -ASM American Samoa -AND Andorra -]]> - </screen> </refsect1> </refentry> http://cvs.php.net/diff.php/phpdoc/en/reference/mysqli/functions/mysqli-execute.xml?r1=1.10&r2=1.11&ty=u Index: phpdoc/en/reference/mysqli/functions/mysqli-execute.xml diff -u phpdoc/en/reference/mysqli/functions/mysqli-execute.xml:1.10 phpdoc/en/reference/mysqli/functions/mysqli-execute.xml:1.11 --- phpdoc/en/reference/mysqli/functions/mysqli-execute.xml:1.10 Wed Feb 25 16:59:16 2004 +++ phpdoc/en/reference/mysqli/functions/mysqli-execute.xml Tue Mar 9 12:21:48 2004 @@ -1,181 +1,28 @@ <?xml version="1.0" encoding="iso-8859-1"?> -<!-- $Revision: 1.10 $ --> +<!-- $Revision: 1.11 $ --> <refentry id="function.mysqli-execute"> <refnamediv> <refname>mysqli_execute</refname> - <refname>stmt->execute</refname> - <refpurpose>Executes a prepared Query</refpurpose> + <refpurpose>Alias for <function>mysqli_stmt_execute</function></refpurpose> </refnamediv> <refsect1> <title>Description</title> - <para>Procedural style:</para> - <methodsynopsis> - <type>bool</type><methodname>mysqli_execute</methodname> - <methodparam><type>object</type><parameter>stmt</parameter></methodparam> - </methodsynopsis> - <para>Object oriented style (method):</para> - <classsynopsis> - <ooclass><classname>mysql</classname></ooclass> - <methodsynopsis> - <type>bool</type> - <methodname>execute</methodname> - <methodparam><type>void</type><parameter></parameter></methodparam> - </methodsynopsis> - </classsynopsis> <para> - 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> object. 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. + This function is an alias of <function>mysqli_stmt_execute</function>. + For a detailled descripton see description of + <function>mysqli_stmt_execute</function>. </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. + <function>mysqli_execute</function> is deprecated and will be removed. </para> </note> </refsect1> <refsect1> - <title>Return values</title> - <para>&return.success;</para> - </refsect1> - <refsect1> <title>See also</title> <para> - <function>mysqli_prepare</function> - <function>mysqli_bind_param</function>. - </para> - </refsect1> - <refsect1> - <title>Example</title> - <example> - <title>Object oriented style</title> - <programlisting role="php"> -<![CDATA[ -<?php -$mysqli = new mysqli("localhost", "my_user", "my_password", "world"); - -/* check connection */ -if (mysqli_connect_errno()) { - printf("Connect failed: %s\n", mysqli_connect_error()); - exit(); -} - -$mysqli->query("CREATE TABLE myCity LIKE City"); - -/* Prepare an insert statement */ -$query = "INSERT INTO myCity (Name, CountryCode, District) VALUES (?,?,?)"; -$stmt = $mysqli->prepare($query); - -$stmt->bind_param("sss", $val1, $val2, $val3); - -$val1 = 'Stuttgart'; -$val2 = 'DEU'; -$val3 = 'Baden-Wuerttemberg'; - -/* Execute the statement */ -$stmt->execute(); - -$val1 = 'Bordeaux'; -$val2 = 'FRA'; -$val3 = 'Aquitaine'; - -/* Execute the statement */ -$stmt->execute(); - -/* close statement */ -$stmt->close(); - -/* retrieve all rows from myCity */ -$query = "SELECT Name, CountryCode, District FROM myCity"; -if ($result = $mysqli->query($query)) { - while ($row = $result->fetch_row()) { - printf("%s (%s,%s)\n", $row[0], $row[1], $row[2]); - } - /* free result set */ - $result->close(); -} - -/* remove table */ -$mysqli->query("DROP TABLE myCity"); - -/* close connection */ -$mysqli->close(); -?> -]]> - </programlisting> - </example> - <example> - <title>Procedural style</title> - <programlisting role="php"> -<![CDATA[ -<?php -$link = mysqli_connect("localhost", "my_user", "my_password", "world"); - -/* check connection */ -if (mysqli_connect_errno()) { - printf("Connect failed: %s\n", mysqli_connect_error()); - exit(); -} - -mysqli_query($link, "CREATE TABLE myCity LIKE City"); - -/* Prepare an insert statement */ -$query = "INSERT INTO myCity (Name, CountryCode, District) VALUES (?,?,?)"; -$stmt = mysqli_prepare($link, $query); - -mysqli_bind_param($stmt, "sss", $val1, $val2, $val3); - -$val1 = 'Stuttgart'; -$val2 = 'DEU'; -$val3 = 'Baden-Wuerttemberg'; - -/* Execute the statement */ -mysqli_execute($stmt); - -$val1 = 'Bordeaux'; -$val2 = 'FRA'; -$val3 = 'Aquitaine'; - -/* Execute the statement */ -mysqli_execute($stmt); - -/* close statement */ -mysqli_stmt_close($stmt); - -/* retrieve all rows from myCity */ -$query = "SELECT Name, CountryCode, District FROM myCity"; -if ($result = mysqli_query($link, $query)) { - while ($row = mysqli_fetch_row($result)) { - printf("%s (%s,%s)\n", $row[0], $row[1], $row[2]); - } - /* free result set */ - mysqli_free_result($result); -} - -/* remove table */ -mysqli_query($link, "DROP TABLE myCity"); - -/* close connection */ -mysqli_close($link); -?> -]]> - </programlisting> - </example> - <para> - The above examples would produce the following output: + <function>mysqli_stmt_execute</function> </para> - <screen> -<![CDATA[ -Stuttgart (DEU,Baden-Wuerttemberg) -Bordeaux (FRA,Aquitaine) -]]> - </screen> </refsect1> </refentry> http://cvs.php.net/diff.php/phpdoc/en/reference/mysqli/functions/mysqli-fetch.xml?r1=1.6&r2=1.7&ty=u Index: phpdoc/en/reference/mysqli/functions/mysqli-fetch.xml diff -u phpdoc/en/reference/mysqli/functions/mysqli-fetch.xml:1.6 phpdoc/en/reference/mysqli/functions/mysqli-fetch.xml:1.7 --- phpdoc/en/reference/mysqli/functions/mysqli-fetch.xml:1.6 Wed Feb 25 16:59:16 2004 +++ phpdoc/en/reference/mysqli/functions/mysqli-fetch.xml Tue Mar 9 12:21:48 2004 @@ -1,165 +1,28 @@ <?xml version="1.0" encoding="iso-8859-1"?> -<!-- $Revision: 1.6 $ --> +<!-- $Revision: 1.7 $ --> <refentry id="function.mysqli-fetch"> <refnamediv> <refname>mysqli_fetch</refname> - <refname>stmt->fetch</refname> - <refpurpose> - Fetch results from a prepared statement into the bound variables - </refpurpose> + <refpurpose>Alias for <function>mysqli_stmt_fetch</function></refpurpose> </refnamediv> <refsect1> <title>Description</title> - <para>Procedural style:</para> - <methodsynopsis> - <type>mixed</type><methodname>mysqli_fetch</methodname> - <methodparam><type>object</type><parameter>stmt</parameter></methodparam> - </methodsynopsis> - <para>Object oriented style (method):</para> - <classsynopsis> - <ooclass><classname>stmt</classname></ooclass> - <methodsynopsis> - <type>mixed</type> - <methodname>fetch</methodname> - <methodparam><type>void</type><parameter></parameter></methodparam> - </methodsynopsis> - </classsynopsis> <para> - <function>mysqli_fetch</function> returns row data using the variables bound by <function>mysqli_bind_result</function>. + This function is an alias of <function>mysqli_stmt_fetch</function>. + For a detailled descripton see description of + <function>mysqli_stmt_fetch</function>. </para> <note> <para> - Note that all columns must be bound by the application before calling <function>mysqli_fetch</function>. + <function>mysqli_fetch</function> is deprecated and will be removed. </para> </note> </refsect1> <refsect1> - <title>Return values</title> - <table> - <title>Return values</title> - <tgroup cols='2'> - <thead> - <row> - <entry>Value</entry> - <entry>Description</entry> - </row> - </thead> - <tbody> - <row> - <entry>&true;</entry> - <entry>Success. Data has been fetched</entry> - </row> - <row> - <entry>&false;</entry> - <entry>Error occured</entry> - </row> - <row> - <entry><literal>&null;</literal></entry> - <entry>No more rows/data exists</entry> - </row> - </tbody> - </tgroup> - </table> - </refsect1> - <refsect1> <title>See also</title> <para> - <function>mysqli_prepare</function>, - <function>mysqli_stmt_errno</function>, - <function>mysqli_stmt_error</function>, - <function>mysqli_bind_result</function> - </para> - </refsect1> - <refsect1> - <title>Example</title> - <example> - <title>Object oriented style</title> - <programlisting role="php"> -<![CDATA[ -<?php -$mysqli = new mysqli("localhost", "my_user", "my_password", "world"); - -/* check connection */ -if (mysqli_connect_errno()) { - printf("Connect failed: %s\n", mysqli_connect_error()); - exit(); -} - -$query = "SELECT Name, CountryCode FROM City ORDER by ID DESC LIMIT 150,5"; - -if ($stmt = $mysqli->prepare($query)) { - - /* execute statement */ - $stmt->execute(); - - /* bind result variables */ - $stmt->bind_result($name, $code); - - /* fetch values */ - while ($stmt->fetch()) { - printf ("%s (%s)\n", $name, $code); - } - - /* close statement */ - $stmt->close(); -} - -/* close connection */ -$mysqli->close(); -?> -]]> - </programlisting> - </example> - <example> - <title>Procedural style</title> - <programlisting role="php"> -<![CDATA[ -<?php -$link = mysqli_connect("localhost", "my_user", "my_password", "world"); - -/* check connection */ -if (mysqli_connect_errno()) { - printf("Connect failed: %s\n", mysqli_connect_error()); - exit(); -} - -$query = "SELECT Name, CountryCode FROM City ORDER by ID DESC LIMIT 150,5"; - -if ($stmt = mysqli_prepare($link, $query)) { - - /* execute statement */ - mysqli_execute($stmt); - - /* bind result variables */ - mysqli_bind_result($stmt, $name, $code); - - /* fetch values */ - while (mysqli_fetch($stmt)) { - printf ("%s (%s)\n", $name, $code); - } - - /* close statement */ - mysqli_stmt_close($stmt); -} - -/* close connection */ -mysqli_close($link); -?> -]]> - </programlisting> - </example> - <para> - The above examples would produce the following output: + <function>mysqli_stmt_fetch</function> </para> - <screen> -<![CDATA[ -Rockford (USA) -Tallahassee (USA) -Salinas (USA) -Santa Clarita (USA) -Springfield (USA) -]]> - </screen> </refsect1> </refentry> http://cvs.php.net/diff.php/phpdoc/en/reference/mysqli/functions/mysqli-get-metadata.xml?r1=1.3&r2=1.4&ty=u Index: phpdoc/en/reference/mysqli/functions/mysqli-get-metadata.xml diff -u phpdoc/en/reference/mysqli/functions/mysqli-get-metadata.xml:1.3 phpdoc/en/reference/mysqli/functions/mysqli-get-metadata.xml:1.4 --- phpdoc/en/reference/mysqli/functions/mysqli-get-metadata.xml:1.3 Sun Feb 22 16:46:41 2004 +++ phpdoc/en/reference/mysqli/functions/mysqli-get-metadata.xml Tue Mar 9 12:21:48 2004 @@ -1,140 +1,27 @@ <?xml version="1.0" encoding="iso-8859-1"?> -<!-- $Revision: 1.3 $ --> +<!-- $Revision: 1.4 $ --> <refentry id="function.mysqli-get-metadata"> <refnamediv> <refname>mysqli_get_metadata</refname> - <refpurpose>returns result set metadata from a prepared statement</refpurpose> + <refpurpose>Alias for <function>mysqli_stmt_result_metadata</function></refpurpose> </refnamediv> <refsect1> <title>Description</title> - <para>Procedural style:</para> - <methodsynopsis> - <type>mixed</type><methodname>mysqli_get_metadata</methodname> - <methodparam><type>object</type><parameter>stmt</parameter></methodparam> - </methodsynopsis> - <para>Object oriented style (method):</para> - <classsynopsis> - <ooclass><classname>stmt</classname></ooclass> - <methodsynopsis> - <type>mixed</type> - <methodname>get_metadata</methodname> - <methodparam><type>void</type><parameter></parameter></methodparam> - </methodsynopsis> - </classsynopsis> <para> - If a statement passed to <function>mysqli_prepare</function> is one that produces - a result set, <function>mysqli_get_metadata</function> returns the result object - that can be used to process the meta information such as total number of fields - and individual field information. - </para> - <note> - <para>This result set pointer can be passed as an argument to any of the - field-based functions that process result set metadata, such as: - <itemizedlist> - <listitem><para><function>mysqli_num_fields</function></para></listitem> - <listitem><para><function>mysqli_fetch_field</function></para></listitem> - <listitem><para><function>mysqli_fetch_field_direct</function></para></listitem> - <listitem><para><function>mysqli_fetch_fields</function></para></listitem> - <listitem><para><function>mysqli_field_count</function></para></listitem> - <listitem><para><function>mysqli_field_seek</function></para></listitem> - <listitem><para><function>mysqli_field_tell</function></para></listitem> - <listitem><para><function>mysqli_free_result</function></para></listitem> - </itemizedlist> - </para> - </note> - <para> - The result set structure should be freed when you are done with it, - which you can do by passing it to <function>mysqli_free_result</function> + This function is an alias of <function>mysqli_stmt_result_metadata</function>. + For a detailled descripton see description of + <function>mysqli_stmt_result_metadata</function>. </para> <note> <para> - The result set returned by <function>mysqli_get_metadata</function> contains only - metadata. It does not contain any row results. The rows are obtained by using the - statement handle with <function>mysqli_fetch</function>. - </para> + <function>mysqli_get_metadata</function> is deprecated and will be removed. + </para> </note> </refsect1> <refsect1> - &reftitle.returnvalues; - <para> - <function>mysqli_get_metadata</function> returns a result object or &false; if - an error occured. - </para> - </refsect1> - <refsect1> - <title>See also:</title> - <para> - <function>mysqli_prepare</function>, - <function>mysqli_free_result</function> - </para> - </refsect1> - <refsect1> - <title>Example</title> + <title>See also</title> <para> - <example> - <title>Object oriented style</title> - <programlisting role='php'> -<![CDATA[ -<?php -$mysqli = new mysqli("localhost", "my_user", "my_password", "test"); - -$mysqli->query("DROP TABLE IF EXISTS friends"); -$mysqli->query("CREATE TABLE friends (id int, name varchar(20))"); - -$mysqli->query("INSERT INTO friends VALUES (1,'Hartmut'), (2, 'Ulf')"); - -$stmt = $mysqli->prepare("SELECT id, name FROM friends"); -$stmt->execute(); - -/* get resultset for metadata */ -$result = $stmt->get_metadata(); - -/* retrieve field information from metadata result set */ -$field = $result->fetch_field(); - -printf("Fieldname: %s\n", $field->name); - -/* close resultset */ -$result->close(); - -/* close connection */ -$mysqli->close(); -?> -]]> - </programlisting> - </example> - <example> - <title>Procedural style</title> - <programlisting role='php'> -<![CDATA[ -<?php -$link = mysqli_connect("localhost", "my_user", "my_password", "test"); - -mysqli_query($link, "DROP TABLE IF EXISTS friends"); -mysqli_query($link, "CREATE TABLE friends (id int, name varchar(20))"); - -mysqli_query($link, "INSERT INTO friends VALUES (1,'Hartmut'), (2, 'Ulf')"); - -$stmt = mysqli_prepare($link, "SELECT id, name FROM friends"); -mysqli_execute($stmt); - -/* get resultset for metadata */ -$result = mysqli_get_metadata($stmt); - -/* retrieve field information from metadata result set */ -$field = mysqli_fetch_field($result); - -printf("Fieldname: %s\n", $field->name); - -/* close resultset */ -mysqli_free_result($result); - -/* close connection */ -mysqli_close($link); -?> -]]> - </programlisting> - </example> + <function>mysqli_stmt_result_metadata</function> </para> </refsect1> </refentry> http://cvs.php.net/diff.php/phpdoc/en/reference/mysqli/functions/mysqli-param-count.xml?r1=1.6&r2=1.7&ty=u Index: phpdoc/en/reference/mysqli/functions/mysqli-param-count.xml diff -u phpdoc/en/reference/mysqli/functions/mysqli-param-count.xml:1.6 phpdoc/en/reference/mysqli/functions/mysqli-param-count.xml:1.7 --- phpdoc/en/reference/mysqli/functions/mysqli-param-count.xml:1.6 Thu Feb 26 09:48:54 2004 +++ phpdoc/en/reference/mysqli/functions/mysqli-param-count.xml Tue Mar 9 12:21:48 2004 @@ -1,106 +1,28 @@ <?xml version="1.0" encoding="iso-8859-1"?> -<!-- $Revision: 1.6 $ --> +<!-- $Revision: 1.7 $ --> <refentry id="function.mysqli-param-count"> <refnamediv> <refname>mysqli_param_count</refname> - <refname>stmt->param_count</refname> - <refpurpose>Returns the number of parameter for the given statement</refpurpose> + <refpurpose>Alias for <function>mysqli_stmt_param_count</function></refpurpose> </refnamediv> <refsect1> <title>Description</title> - <para>Procedural style:</para> - <methodsynopsis> - <type>int</type><methodname>mysqli_param_count</methodname> - <methodparam><type>object</type><parameter>stmt</parameter></methodparam> - </methodsynopsis> - <para>Object oriented style (property):</para> - <classsynopsis> - <ooclass><classname>stmt</classname></ooclass> - <fieldsynopsis><type>int</type><varname>param_count</varname></fieldsynopsis> - </classsynopsis> - <para> - <function>mysqli_param_count</function> returns the number of parameter - markers present in the prepared statement. - </para> - </refsect1> - <refsect1> - &reftitle.returnvalues; - <para> - returns an integer representing the number of parameters. - </para> - </refsect1> - <refsect1> - &reftitle.seealso; <para> - <function>mysqli_prepare</function> + This function is an alias of <function>mysqli_stmt_param_count</function>. + For a detailled descripton see description of + <function>mysqli_stmt_param_count</function>. </para> + <note> + <para> + <function>mysqli_param_count</function> is deprecated and will be removed. + </para> + </note> </refsect1> <refsect1> - <title>Example</title> - <example> - <title>Object oriented style</title> - <programlisting role="php"> -<![CDATA[ -<?php -$mysqli = new mysqli("localhost", "my_user", "my_password", "world"); - -/* check connection */ -if (mysqli_connect_errno()) { - printf("Connect failed: %s\n", mysqli_connect_error()); - exit(); -} - -if ($stmt = $mysqli->prepare("SELECT Name FROM Country WHERE Name=? OR Code=?")) { - - $marker = $stmt->param_count; - printf("Statement has %d markers.\n", $marker); - - /* close statement */ - $stmt->close(); -} - -/* close connection */ -$mysqli->close(); -?> -]]> - </programlisting> - </example> - <example> - <title>Procedural style</title> - <programlisting role="php"> -<![CDATA[ -<?php -$link = mysqli_connect("localhost", "my_user", "my_password", "world"); - -/* check connection */ -if (mysqli_connect_errno()) { - printf("Connect failed: %s\n", mysqli_connect_error()); - exit(); -} - -if ($stmt = mysqli_prepare($link, "SELECT Name FROM Country WHERE Name=? OR Code=?")) { - - $marker = mysqli_param_count($stmt); - printf("Statement has %d markers.\n", $marker); - - /* close statement */ - mysqli_stmt_close($stmt); -} - -/* close connection */ -mysqli_close($link); -?> -]]> - </programlisting> - </example> + <title>See also</title> <para> - The above examples would produce the following output: + <function>mysqli_stmt_param_count</function> </para> - <screen> -<![CDATA[ -Statement has 2 markers. -]]> - </screen> </refsect1> </refentry> http://cvs.php.net/diff.php/phpdoc/en/reference/mysqli/functions/mysqli-prepare.xml?r1=1.4&r2=1.5&ty=u Index: phpdoc/en/reference/mysqli/functions/mysqli-prepare.xml diff -u phpdoc/en/reference/mysqli/functions/mysqli-prepare.xml:1.4 phpdoc/en/reference/mysqli/functions/mysqli-prepare.xml:1.5 --- phpdoc/en/reference/mysqli/functions/mysqli-prepare.xml:1.4 Thu Feb 26 09:48:54 2004 +++ phpdoc/en/reference/mysqli/functions/mysqli-prepare.xml Tue Mar 9 12:21:48 2004 @@ -1,9 +1,9 @@ <?xml version="1.0" encoding="iso-8859-1"?> -<!-- $Revision: 1.4 $ --> +<!-- $Revision: 1.5 $ --> <refentry id="function.mysqli-prepare"> <refnamediv> <refname>mysqli_prepare</refname> - <refname>stmt->prepare</refname> + <refname>mysqli->prepare</refname> <refpurpose> Prepare a SQL statement for execution </refpurpose> @@ -60,7 +60,7 @@ </note> <para> The parameter markers must be bound to application variables using - <function>mysqli_bind_param</function> and/or <function>mysqli_bind_result</function> + <function>mysqli_stmt_bind_param</function> and/or <function>mysqli_stmt_bind_result</function> before executing the statement or fetching rows. </para> </refsect1> @@ -73,10 +73,10 @@ <refsect1> &reftitle.seealso; <para> - <function>mysqli_execute</function> - <function>mysqli_fetch</function> - <function>mysqli_bind_param</function> - <function>mysqli_bind_result</function> + <function>mysqli_stmt_execute</function>, + <function>mysqli_stmt_fetch</function>, + <function>mysqli_stmt_bind_param</function>, + <function>mysqli_stmt_bind_result</function>, <function>mysqli_stmt_close</function> </para> </refsect1> @@ -143,16 +143,16 @@ if ($stmt = mysqli_prepare($link, "SELECT District FROM City WHERE Name=?")) { /* bind parameters for markers */ - mysqli_bind_param($stmt, "s", $city); + mysqli_stmt_bind_param($stmt, "s", $city); /* execute query */ - mysqli_execute($stmt); + mysqli_stmt_execute($stmt); /* bind result variables */ - mysqli_bind_result($stmt, $district); + mysqli_stmt_bind_result($stmt, $district); /* fetch value */ - mysqli_fetch($stmt); + mysqli_stmt_fetch($stmt); printf("%s is in district %s\n", $city, $district); http://cvs.php.net/diff.php/phpdoc/en/reference/mysqli/functions/mysqli-send-long-data.xml?r1=1.3&r2=1.4&ty=u Index: phpdoc/en/reference/mysqli/functions/mysqli-send-long-data.xml diff -u phpdoc/en/reference/mysqli/functions/mysqli-send-long-data.xml:1.3 phpdoc/en/reference/mysqli/functions/mysqli-send-long-data.xml:1.4 --- phpdoc/en/reference/mysqli/functions/mysqli-send-long-data.xml:1.3 Wed Jan 28 18:18:42 2004 +++ phpdoc/en/reference/mysqli/functions/mysqli-send-long-data.xml Tue Mar 9 12:21:48 2004 @@ -1,49 +1,27 @@ <?xml version="1.0" encoding="iso-8859-1"?> -<!-- $Revision: 1.3 $ --> +<!-- $Revision: 1.4 $ --> <refentry id="function.mysqli-send-long-data"> <refnamediv> - <refname>mysqli_send_long_data</refname> - <refname>stmt->send_long_data</refname> - <refpurpose>Send data in blocks</refpurpose> + <refname>mysqli_send_long_datat</refname> + <refpurpose>Alias for <function>mysqli_stmt_send_long_data</function></refpurpose> </refnamediv> <refsect1> <title>Description</title> - <para>Procedural style:</para> - <methodsynopsis> - <type>bool</type><methodname>mysqli_send_long_data</methodname> - <methodparam><type>object</type><parameter>stmt</parameter></methodparam> - <methodparam><type>int</type><parameter>param_nr</parameter></methodparam> - <methodparam><type>string</type><parameter>data</parameter></methodparam> - </methodsynopsis> - <para>Object oriented style (method)</para> - <classsynopsis> - <ooclass><classname>stmt</classname></ooclass> - <methodsynopsis> - <type>bool</type><methodname>send_long_data</methodname> - <methodparam><type>int</type><parameter>param_nr</parameter></methodparam> - <methodparam><type>string</type><parameter>data</parameter></methodparam> - </methodsynopsis> - </classsynopsis> - <para> - Allows to send parameter data to the server in pieces (or chunks), e.g. if the - size of a blob exceeds the size of <literal>max_allowed_packet</literal>. - This function can be called multiple times to send the parts of a character or - binary data value for a column, which must be one of the TEXT or BLOB datatypes. - </para> + <para> + This function is an alias of <function>mysqli_stmt_send_long_data</function>. + For a detailled descripton see description of + <function>mysqli_stmt_send_long_data</function>. + </para> + <note> <para> - <parameter>param_nr</parameter> indicates which parameter to associate the data with. - Parameters are numbered beginning with 0. data is a string containing data to be sent. + <function>mysqli_send_long_data</function> is deprecated and will be removed. </para> - </refsect1> - <refsect1> - <title>Return values</title> - <para>&return.success;</para> + </note> </refsect1> <refsect1> <title>See also</title> <para> - <function>mysqli_prepare</function>, - <function>mysqli_bind_param</function> + <function>mysqli_stmt_send_long_data</function> </para> </refsect1> </refentry> http://cvs.php.net/diff.php/phpdoc/en/reference/mysqli/functions/mysqli-stmt-affected-rows.xml?r1=1.4&r2=1.5&ty=u Index: phpdoc/en/reference/mysqli/functions/mysqli-stmt-affected-rows.xml diff -u phpdoc/en/reference/mysqli/functions/mysqli-stmt-affected-rows.xml:1.4 phpdoc/en/reference/mysqli/functions/mysqli-stmt-affected-rows.xml:1.5 --- phpdoc/en/reference/mysqli/functions/mysqli-stmt-affected-rows.xml:1.4 Fri Feb 27 04:22:17 2004 +++ phpdoc/en/reference/mysqli/functions/mysqli-stmt-affected-rows.xml Tue Mar 9 12:21:48 2004 @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="iso-8859-1"?> -<!-- $Revision: 1.4 $ --> +<!-- $Revision: 1.5 $ --> <refentry id="function.mysqli-stmt-affected-rows"> <refnamediv> <refname>mysqli_stmt_affected_rows</refname> @@ -117,10 +117,10 @@ /* Bind variable for placeholder */ $code = 'A%'; - mysqli_bind_param($stmt, "s", $code); + mysqli_stmt_bind_param($stmt, "s", $code); /* execute statement */ - mysqli_execute($stmt); + mysqli_stmt_execute($stmt); printf("rows inserted: %d\n", mysqli_stmt_affected_rows($stmt)); http://cvs.php.net/diff.php/phpdoc/en/reference/mysqli/functions/mysqli-stmt-close.xml?r1=1.3&r2=1.4&ty=u Index: phpdoc/en/reference/mysqli/functions/mysqli-stmt-close.xml diff -u phpdoc/en/reference/mysqli/functions/mysqli-stmt-close.xml:1.3 phpdoc/en/reference/mysqli/functions/mysqli-stmt-close.xml:1.4 --- phpdoc/en/reference/mysqli/functions/mysqli-stmt-close.xml:1.3 Wed Jan 28 18:18:42 2004 +++ phpdoc/en/reference/mysqli/functions/mysqli-stmt-close.xml Tue Mar 9 12:21:48 2004 @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="iso-8859-1"?> -<!-- $Revision: 1.3 $ --> +<!-- $Revision: 1.4 $ --> <refentry id="function.mysqli-stmt-close"> <refnamediv> <refname>mysqli_stmt_close</refname> @@ -35,9 +35,7 @@ <refsect1> <title>See also</title> <para> - <function>mysqli_stmt_num_rows</function>, <function>mysqli_prepare</function>, - <function>mysqli_execute</function> </para> </refsect1> </refentry> http://cvs.php.net/diff.php/phpdoc/en/reference/mysqli/functions/mysqli-stmt-data-seek.xml?r1=1.3&r2=1.4&ty=u Index: phpdoc/en/reference/mysqli/functions/mysqli-stmt-data-seek.xml diff -u phpdoc/en/reference/mysqli/functions/mysqli-stmt-data-seek.xml:1.3 phpdoc/en/reference/mysqli/functions/mysqli-stmt-data-seek.xml:1.4 --- phpdoc/en/reference/mysqli/functions/mysqli-stmt-data-seek.xml:1.3 Fri Feb 27 04:22:17 2004 +++ phpdoc/en/reference/mysqli/functions/mysqli-stmt-data-seek.xml Tue Mar 9 12:21:48 2004 @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="iso-8859-1"?> -<!-- $Revision: 1.3 $ --> +<!-- $Revision: 1.4 $ --> <refentry id="function.mysqli-stmt-data-seek"> <refnamediv> <refname>mysqli_stmt_data_seek</refname> @@ -106,10 +106,10 @@ if ($stmt = mysqli_prepare($link, $query)) { /* execute query */ - mysqli_execute($stmt); + mysqli_stmt_execute($stmt); /* bind result variables */ - mysqli_bind_result($stmt, $name, $code); + mysqli_stmt_bind_result($stmt, $name, $code); /* store result */ mysqli_stmt_store_result($stmt); @@ -118,7 +118,7 @@ mysqli_stmt_data_seek($stmt, 399); /* fetch values */ - mysqli_fetch($stmt); + mysqli_stmt_fetch($stmt); printf ("City: %s Countrycode: %s\n", $name, $code); http://cvs.php.net/diff.php/phpdoc/en/reference/mysqli/functions/mysqli-stmt-errno.xml?r1=1.4&r2=1.5&ty=u Index: phpdoc/en/reference/mysqli/functions/mysqli-stmt-errno.xml diff -u phpdoc/en/reference/mysqli/functions/mysqli-stmt-errno.xml:1.4 phpdoc/en/reference/mysqli/functions/mysqli-stmt-errno.xml:1.5 --- phpdoc/en/reference/mysqli/functions/mysqli-stmt-errno.xml:1.4 Fri Feb 27 04:22:17 2004 +++ phpdoc/en/reference/mysqli/functions/mysqli-stmt-errno.xml Tue Mar 9 12:21:48 2004 @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="iso-8859-1"?> -<!-- $Revision: 1.4 $ --> +<!-- $Revision: 1.5 $ --> <refentry id="function.mysqli-stmt-errno"> <refnamediv> <refname>mysqli_stmt_errno</refname> @@ -110,7 +110,7 @@ mysqli_query($link, "DROP TABLE myCountry"); /* execute query */ - mysqli_execute($stmt); + mysqli_stmt_execute($stmt); printf("Error: %d.\n", mysqli_stmt_errno($stmt)); http://cvs.php.net/diff.php/phpdoc/en/reference/mysqli/functions/mysqli-stmt-error.xml?r1=1.4&r2=1.5&ty=u Index: phpdoc/en/reference/mysqli/functions/mysqli-stmt-error.xml diff -u phpdoc/en/reference/mysqli/functions/mysqli-stmt-error.xml:1.4 phpdoc/en/reference/mysqli/functions/mysqli-stmt-error.xml:1.5 --- phpdoc/en/reference/mysqli/functions/mysqli-stmt-error.xml:1.4 Fri Feb 27 04:22:17 2004 +++ phpdoc/en/reference/mysqli/functions/mysqli-stmt-error.xml Tue Mar 9 12:21:48 2004 @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="iso-8859-1"?> -<!-- $Revision: 1.4 $ --> +<!-- $Revision: 1.5 $ --> <refentry id="function.mysqli-stmt-error"> <refnamediv> <refname>mysqli_stmt_error</refname> @@ -103,7 +103,7 @@ mysqli_query($link, "DROP TABLE myCountry"); /* execute query */ - mysqli_execute($stmt); + mysqli_stmt_execute($stmt); printf("Error: %s.\n", mysqli_stmt_error($stmt)); http://cvs.php.net/diff.php/phpdoc/en/reference/mysqli/functions/mysqli-stmt-num-rows.xml?r1=1.2&r2=1.3&ty=u Index: phpdoc/en/reference/mysqli/functions/mysqli-stmt-num-rows.xml diff -u phpdoc/en/reference/mysqli/functions/mysqli-stmt-num-rows.xml:1.2 phpdoc/en/reference/mysqli/functions/mysqli-stmt-num-rows.xml:1.3 --- phpdoc/en/reference/mysqli/functions/mysqli-stmt-num-rows.xml:1.2 Fri Feb 27 04:22:17 2004 +++ phpdoc/en/reference/mysqli/functions/mysqli-stmt-num-rows.xml Tue Mar 9 12:21:48 2004 @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="iso-8859-1"?> -<!-- $Revision: 1.2 $ --> +<!-- $Revision: 1.3 $ --> <refentry id="function.mysqli-stmt-num-rows"> <refnamediv> <refname>mysqli_stmt_num_rows</refname> @@ -97,7 +97,7 @@ if ($stmt = mysqli_prepare($link, $query)) { /* execute query */ - mysqli_execute($stmt); + mysqli_stmt_execute($stmt); /* store result */ mysqli_stmt_store_result($stmt); http://cvs.php.net/diff.php/phpdoc/en/reference/mysqli/functions/mysqli-stmt-sqlstate.xml?r1=1.2&r2=1.3&ty=u Index: phpdoc/en/reference/mysqli/functions/mysqli-stmt-sqlstate.xml diff -u phpdoc/en/reference/mysqli/functions/mysqli-stmt-sqlstate.xml:1.2 phpdoc/en/reference/mysqli/functions/mysqli-stmt-sqlstate.xml:1.3 --- phpdoc/en/reference/mysqli/functions/mysqli-stmt-sqlstate.xml:1.2 Fri Feb 27 04:22:17 2004 +++ phpdoc/en/reference/mysqli/functions/mysqli-stmt-sqlstate.xml Tue Mar 9 12:21:48 2004 @@ -1,9 +1,9 @@ <?xml version="1.0" encoding="iso-8859-1"?> -<!-- $Revision: 1.2 $ --> +<!-- $Revision: 1.3 $ --> <refentry id="function.mysqli-stmt-sqlstate"> <refnamediv> <refname>mysqli_stmt_sqlstate</refname> - <refpurpose></refpurpose> + <refpurpose>returns SQLSTATE error from previous statement operation</refpurpose> </refnamediv> <refsect1> <title>Description</title> @@ -105,7 +105,7 @@ mysqli_query($link, "DROP TABLE myCountry"); /* execute query */ - mysqli_execute($stmt); + mysqli_stmt_execute($stmt); printf("Error: %s.\n", mysqli_stmt_sqlstate($stmt)); http://cvs.php.net/diff.php/phpdoc/en/reference/mysqli/functions/mysqli-stmt-store-result.xml?r1=1.3&r2=1.4&ty=u Index: phpdoc/en/reference/mysqli/functions/mysqli-stmt-store-result.xml diff -u phpdoc/en/reference/mysqli/functions/mysqli-stmt-store-result.xml:1.3 phpdoc/en/reference/mysqli/functions/mysqli-stmt-store-result.xml:1.4 --- phpdoc/en/reference/mysqli/functions/mysqli-stmt-store-result.xml:1.3 Fri Feb 27 04:22:17 2004 +++ phpdoc/en/reference/mysqli/functions/mysqli-stmt-store-result.xml Tue Mar 9 12:21:48 2004 @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="iso-8859-1"?> -<!-- $Revision: 1.3 $ --> +<!-- $Revision: 1.4 $ --> <refentry id="function.mysqli-stmt-store-result"> <refnamediv> <refname>mysqli_stmt_store_result</refname> @@ -32,7 +32,7 @@ It is unnecessary to call <function>mysql_stmt_store_result</function> for other queries, but if you do, it will not harm or cause any notable performance in all cases. You can detect whether the query produced a result set by checking if - <function>mysql_get_metadata</function> returns NULL. + <function>mysql_stmt_result_metadata</function> returns NULL. </para> </note> </refsect1> @@ -44,7 +44,7 @@ <title>See also</title> <para> <function>mysqli_prepare</function>, - <function>mysqli_get_metadata</function>, + <function>mysqli_stmt_result_metadata</function>, <function>mysqli_fetch</function> </para> </refsect1> @@ -103,7 +103,7 @@ if ($stmt = mysqli_prepare($link, $query)) { /* execute query */ - mysqli_execute($stmt); + mysqli_stmt_execute($stmt); /* store result */ mysqli_stmt_store_result($stmt); http://cvs.php.net/co.php/phpdoc/en/reference/mysqli/functions/mysqli-stmt-bind-param.xml?r=1.1&p=1 Index: phpdoc/en/reference/mysqli/functions/mysqli-stmt-bind-param.xml +++ phpdoc/en/reference/mysqli/functions/mysqli-stmt-bind-param.xml <?xml version="1.0" encoding="iso-8859-1"?> <!-- $Revision: 1.1 $ --> <refentry id="function.mysqli-stmt-bind-param"> <refnamediv> <refname>mysqli_stmt_bind_param</refname> <refname>stmt->bind_param</refname> <refpurpose>Binds variables to a prepared statement as parameters</refpurpose> </refnamediv> <refsect1> <title>Description</title> <para>Procedural style:</para> <methodsynopsis> <type>bool</type><methodname>mysqli_stmt_bind_param</methodname> <methodparam><type>object</type><parameter>stmt</parameter></methodparam> <methodparam><type>string</type><parameter>types</parameter></methodparam> <methodparam><type>mixed</type><parameter>var1</parameter></methodparam> <methodparam choice="opt"><type>mixed</type><parameter>var2, ...</parameter></methodparam> </methodsynopsis> <para>Object oriented style (method):</para> <classsynopsis> <ooclass><classname>stmt</classname></ooclass> <methodsynopsis> <type>bool</type> <methodname>bind_param</methodname> <methodparam><type>array</type><parameter>types</parameter></methodparam> <methodparam><type>mixed</type><parameter>var1</parameter></methodparam> <methodparam choice="opt"><type>mixed</type><parameter>var2, ...</parameter></methodparam> </methodsynopsis> </classsynopsis> <para> <function>mysql_bind_param</function> is used to bind variables for the parameter markers in the SQL statement that was passed to <function>mysql_prepare</function>. The string <parameter>types</parameter> contains one or more characters which specify the types for the corresponding bind variables <table> <title>Type specification chars</title> <tgroup cols='2'> <thead> <row> <entry>Character</entry> <entry>Description</entry> </row> </thead> <tbody> <row> <entry>i</entry> <entry>corresponding variable has type integer</entry> </row> <row> <entry>d</entry> <entry>corresponding variable has type double</entry> </row> <row> <entry>s</entry> <entry>corresponding variable has type string</entry> </row> <row> <entry>b</entry> <entry>corresponding variable is a blob and will be send in packages</entry> </row> </tbody> </tgroup> </table> </para> <note> <para> If data size of a variable exceeds max. allowed package size (max_allowed_package), you have to specify <literal>b</literal> in <parameter>types</parameter> and use <function>mysqli_stmt_send_long_data</function> to send the data in packages. </para> <para> The number of variables and length of string <parameter>types</parameter> must match the parameters in the statement. </para> </note> </refsect1> <refsect1> <title>Return values</title> <para> &return.success; </para> </refsect1> <refsect1> <title>See also</title> <para> <function>mysqli_stmt_bind_result</function>, <function>mysqi_stmt_execute</function>, <function>mysqi_stmt_fetch</function>, <function>mysqli_prepare</function>, <function>mysqli_stmt_send_long_data</function>, <function>mysqli_stmt_errno</function>, <function>mysqli_stmt_error</function> </para> </refsect1> <refsect1> <title>Example</title> <example> <title>Object oriented style</title> <programlisting role="php"> <![CDATA[ <?php $mysqli = new mysqli('localhost', 'my_user', 'my_password', 'world'); /* check connection */ if (mysqli_connect_errno()) { printf("Connect failed: %s\n", mysqli_connect_error()); exit(); } $stmt = $mysqli->prepare("INSERT INTO CountryLanguage VALUES (?, ?, ?, ?)"); $stmt->bind_param('sssd', $code, $language, $official, $percent); $code = 'DEU'; $language = 'Bavarian'; $official = "F"; $percent = 11.2; /* execute prepared statement */ $stmt->execute(); printf("%d Row inserted.\n", $stmt->affected_rows); /* close statement and connection */ $stmt->close(); /* Clean up table CountryLanguage */ $mysqli->query("DELETE FROM CountryLanguage WHERE Language='Bavarian'"); printf("%d Row deleted.\n", $mysqli->affected_rows); /* close connection */ $mysqli->close(); ?> ]]> </programlisting> </example> <example> <title>Procedural style</title> <programlisting role="php"> <![CDATA[ <?php $link = mysqli_connect('localhost', 'my_user', 'my_password', 'world'); /* check connection */ if (!$link) { printf("Connect failed: %s\n", mysqli_connect_error()); exit(); } $stmt = mysqli_prepare($link, "INSERT INTO CountryLanguage VALUES (?, ?, ?, ?)"); mysqli_stmt_bind_param($stmt, 'sssd', $code, $language, $official, $percent); $code = 'DEU'; $language = 'Bavarian'; $official = "F"; $percent = 11.2; /* execute prepared statement */ mysqi_stmt_execute($stmt); printf("%d Row inserted.\n", mysqli_stmt_affected_rows($stmt)); /* close statement and connection */ mysqli_stmt_close($stmt); /* Clean up table CountryLanguage */ mysqli_query($link, "DELETE FROM CountryLanguage WHERE Language='Bavarian'"); printf("%d Row deleted.\n", mysqli_affected_rows($link)); /* close connection */ mysqli_close($link); ?> ]]> </programlisting> </example> <para> The above examples would produce the following output: </para> <screen> <![CDATA[ 1 Row inserted. 1 Row deleted. ]]> </screen> </refsect1> </refentry> <!-- Keep this comment at the end of the file Local variables: mode: sgml sgml-omittag:t sgml-shorttag:t sgml-minimize-attributes:nil sgml-always-quote-attributes:t sgml-indent-step:1 sgml-indent-data:t indent-tabs-mode:nil sgml-parent-document:nil sgml-default-dtd-file:"../../../../manual.ced" sgml-exposed-tags:nil sgml-local-catalogs:nil sgml-local-ecat-files:nil End: vim600: syn=xml fen fdm=syntax fdl=2 si vim: et tw=78 syn=sgml vi: ts=1 sw=1 --> http://cvs.php.net/co.php/phpdoc/en/reference/mysqli/functions/mysqli-stmt-bind-result.xml?r=1.1&p=1 Index: phpdoc/en/reference/mysqli/functions/mysqli-stmt-bind-result.xml +++ phpdoc/en/reference/mysqli/functions/mysqli-stmt-bind-result.xml <?xml version="1.0" encoding="iso-8859-1"?> <!-- $Revision: 1.1 $ --> <refentry id="function.mysqli-stmt-bind-result"> <refnamediv> <refname>mysqli_stmt_bind_result</refname> <refname>stmt->bind_result</refname> <refpurpose>Binds variables to a prepared statement for result storage</refpurpose> </refnamediv> <refsect1> <title>Description</title> <para>Procedural style:</para> <methodsynopsis> <type>bool</type><methodname>mysqli_stnt_bind_result</methodname> <methodparam><type>object</type><parameter>stmt</parameter></methodparam> <methodparam><type>mixed</type><parameter>var1</parameter></methodparam> <methodparam choice="opt"><type>mixed</type><parameter>var2, ...</parameter></methodparam> </methodsynopsis> <para>Object oriented style (method):</para> <classsynopsis> <ooclass><classname>stmt</classname></ooclass> <methodsynopsis> <type>bool</type> <methodname>bind_result</methodname> <methodparam><type>mixed</type><parameter>var1</parameter></methodparam> <methodparam choice="opt"><type>mixed</type><parameter>var2, ...</parameter></methodparam> </methodsynopsis> </classsynopsis> <para> <function>mysqli_stmt_bind_result</function> is used to associate (bind) columns in the result set to variables. When <function>mysqli_stmt_fetch</function> is called to fetch data, the MySQL client/server protocol places the data for the bound columns into the specified variables <parameter>var1, ...</parameter>. </para> <note> <para> Note that all columns must be bound prior to calling <function>mysqli_stmt_fetch</function>. Depending on column types bound variables can silently change to the corresponding PHP type. </para> <para> A column can be bound or rebound at any time, even after a result set has been partially retrieved. The new binding takes effect the next time <function>mysqli_stmt_fetch</function> is called. </para> </note> </refsect1> <refsect1> <title>Return values</title> <para> &return.success; </para> </refsect1> <refsect1> <title>See also</title> <para> <function>mysqli_stmt_bind_param</function>, <function>mysqli_stmt_execute</function>, <function>mysqli_stmt_fetch</function>, <function>mysqli_prepare</function>, <function>mysqli_stmt_prepare</function>, <function>mysqli_stmt_init</function>, <function>mysqli_stmt_errno</function>, <function>mysqli_stmt_error</function> </para> </refsect1> <refsect1> <title>Example</title> <example> <title>Object oriented style</title> <programlisting role="php"> <![CDATA[ <?php $mysqli = new mysqli("localhost", "my_user", "my_password", "world"); if (mysqli_connect_errno()) { printf("Connect failed: %s\n", mysqli_connect_error()); exit(); } /* prepare statement */ if ($stmt = $mysqli->prepare("SELECT Code, Name FROM Country ORDER BY Name LIMIT 5")) { $stmt->execute(); /* bind variables to prepared statement */ $stmt->bind_result($col1, $col2); /* fetch values */ while ($stmt->fetch()) { printf("%s %s\n", $col1, $col2); } /* close statement */ $stmt->close(); } /* close connection */ $mysqli->close(); ?> ]]> </programlisting> </example> <example> <title>Procedural style</title> <programlisting role="php"> <![CDATA[ <?php $link = mysqli_connect("localhost", "my_user", "my_password", "world"); /* check connection */ if (!$link) { printf("Connect failed: %s\n", mysqli_connect_error()); exit(); } /* prepare statement */ if ($stmt = mysqli_prepare($link, "SELECT Code, Name FROM Country ORDER BY Name LIMIT 5")) { mysqli_stmt_execute($stmt); /* bind variables to prepared statement */ mysqli_stmt_bind_result($stmt, $col1, $col2); /* fetch values */ while (mysqli_stmt_fetch($stmt)) { printf("%s %s\n", $col1, $col2); } /* close statement */ mysqli_stmt_close($stmt); } /* close connection */ mysqli_close($link); ?> ]]> </programlisting> </example> <para> The above examples would produce the following output: </para> <screen> <![CDATA[ AFG Afghanistan ALB Albania DZA Algeria ASM American Samoa AND Andorra ]]> </screen> </refsect1> </refentry> <!-- Keep this comment at the end of the file Local variables: mode: sgml sgml-omittag:t sgml-shorttag:t sgml-minimize-attributes:nil sgml-always-quote-attributes:t sgml-indent-step:1 sgml-indent-data:t indent-tabs-mode:nil sgml-parent-document:nil sgml-default-dtd-file:"../../../../manual.ced" sgml-exposed-tags:nil sgml-local-catalogs:nil sgml-local-ecat-files:nil End: vim600: syn=xml fen fdm=syntax fdl=2 si vim: et tw=78 syn=sgml vi: ts=1 sw=1 --> http://cvs.php.net/co.php/phpdoc/en/reference/mysqli/functions/mysqli-stmt-execute.xml?r=1.1&p=1 Index: phpdoc/en/reference/mysqli/functions/mysqli-stmt-execute.xml +++ phpdoc/en/reference/mysqli/functions/mysqli-stmt-execute.xml <?xml version="1.0" encoding="iso-8859-1"?> <!-- $Revision: 1.1 $ --> <refentry id="function.mysqli-stmt-execute"> <refnamediv> <refname>mysqli_stmt_execute</refname> <refname>stmt->execute</refname> <refpurpose>Executes a prepared Query</refpurpose> </refnamediv> <refsect1> <title>Description</title> <para>Procedural style:</para> <methodsynopsis> <type>bool</type><methodname>mysqli_stmt_execute</methodname> <methodparam><type>object</type><parameter>stmt</parameter></methodparam> </methodsynopsis> <para>Object oriented style (method):</para> <classsynopsis> <ooclass><classname>mysql</classname></ooclass> <methodsynopsis> <type>bool</type> <methodname>execute</methodname> <methodparam><type>void</type><parameter></parameter></methodparam> </methodsynopsis> </classsynopsis> <para> The <function>mysqli_stmt_execute</function> function executes a query that has been previously prepared using the <function>mysqli_prepare</function> function represented by the <parameter>stmt</parameter> object. 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_stmt_execute</function>, the <function>mysqli_fetch</function> function must be used to fetch the data prior to preforming any additional queries. </para> </note> </refsect1> <refsect1> <title>Return values</title> <para>&return.success;</para> </refsect1> <refsect1> <title>See also</title> <para> <function>mysqli_prepare</function> <function>mysqli_stmt_bind_param</function>. </para> </refsect1> <refsect1> <title>Example</title> <example> <title>Object oriented style</title> <programlisting role="php"> <![CDATA[ <?php $mysqli = new mysqli("localhost", "my_user", "my_password", "world"); /* check connection */ if (mysqli_connect_errno()) { printf("Connect failed: %s\n", mysqli_connect_error()); exit(); } $mysqli->query("CREATE TABLE myCity LIKE City"); /* Prepare an insert statement */ $query = "INSERT INTO myCity (Name, CountryCode, District) VALUES (?,?,?)"; $stmt = $mysqli->prepare($query); $stmt->bind_param("sss", $val1, $val2, $val3); $val1 = 'Stuttgart'; $val2 = 'DEU'; $val3 = 'Baden-Wuerttemberg'; /* Execute the statement */ $stmt->execute(); $val1 = 'Bordeaux'; $val2 = 'FRA'; $val3 = 'Aquitaine'; /* Execute the statement */ $stmt->execute(); /* close statement */ $stmt->close(); /* retrieve all rows from myCity */ $query = "SELECT Name, CountryCode, District FROM myCity"; if ($result = $mysqli->query($query)) { while ($row = $result->fetch_row()) { printf("%s (%s,%s)\n", $row[0], $row[1], $row[2]); } /* free result set */ $result->close(); } /* remove table */ $mysqli->query("DROP TABLE myCity"); /* close connection */ $mysqli->close(); ?> ]]> </programlisting> </example> <example> <title>Procedural style</title> <programlisting role="php"> <![CDATA[ <?php $link = mysqli_connect("localhost", "my_user", "my_password", "world"); /* check connection */ if (mysqli_connect_errno()) { printf("Connect failed: %s\n", mysqli_connect_error()); exit(); } mysqli_query($link, "CREATE TABLE myCity LIKE City"); /* Prepare an insert statement */ $query = "INSERT INTO myCity (Name, CountryCode, District) VALUES (?,?,?)"; $stmt = mysqli_prepare($link, $query); mysqli_stmt_bind_param($stmt, "sss", $val1, $val2, $val3); $val1 = 'Stuttgart'; $val2 = 'DEU'; $val3 = 'Baden-Wuerttemberg'; /* Execute the statement */ mysqli_stmt_execute($stmt); $val1 = 'Bordeaux'; $val2 = 'FRA'; $val3 = 'Aquitaine'; /* Execute the statement */ mysqli_stmt_execute($stmt); /* close statement */ mysqli_stmt_close($stmt); /* retrieve all rows from myCity */ $query = "SELECT Name, CountryCode, District FROM myCity"; if ($result = mysqli_query($link, $query)) { while ($row = mysqli_fetch_row($result)) { printf("%s (%s,%s)\n", $row[0], $row[1], $row[2]); } /* free result set */ mysqli_free_result($result); } /* remove table */ mysqli_query($link, "DROP TABLE myCity"); /* close connection */ mysqli_close($link); ?> ]]> </programlisting> </example> <para> The above examples would produce the following output: </para> <screen> <![CDATA[ Stuttgart (DEU,Baden-Wuerttemberg) Bordeaux (FRA,Aquitaine) ]]> </screen> </refsect1> </refentry> <!-- Keep this comment at the end of the file Local variables: mode: sgml sgml-omittag:t sgml-shorttag:t sgml-minimize-attributes:nil sgml-always-quote-attributes:t sgml-indent-step:1 sgml-indent-data:t indent-tabs-mode:nil sgml-parent-document:nil sgml-default-dtd-file:"../../../../manual.ced" sgml-exposed-tags:nil sgml-local-catalogs:nil sgml-local-ecat-files:nil End: vim600: syn=xml fen fdm=syntax fdl=2 si vim: et tw=78 syn=sgml vi: ts=1 sw=1 --> http://cvs.php.net/co.php/phpdoc/en/reference/mysqli/functions/mysqli-stmt-fetch.xml?r=1.1&p=1 Index: phpdoc/en/reference/mysqli/functions/mysqli-stmt-fetch.xml +++ phpdoc/en/reference/mysqli/functions/mysqli-stmt-fetch.xml <?xml version="1.0" encoding="iso-8859-1"?> <!-- $Revision: 1.1 $ --> <refentry id="function.mysqli-stmt-fetch"> <refnamediv> <refname>mysqli_stmt_fetch</refname> <refname>stmt->fetch</refname> <refpurpose> Fetch results from a prepared statement into the bound variables </refpurpose> </refnamediv> <refsect1> <title>Description</title> <para>Procedural style:</para> <methodsynopsis> <type>mixed</type><methodname>mysqli_stmt_fetch</methodname> <methodparam><type>object</type><parameter>stmt</parameter></methodparam> </methodsynopsis> <para>Object oriented style (method):</para> <classsynopsis> <ooclass><classname>stmt</classname></ooclass> <methodsynopsis> <type>mixed</type> <methodname>fetch</methodname> <methodparam><type>void</type><parameter></parameter></methodparam> </methodsynopsis> </classsynopsis> <para> <function>mysqli_stmt_fetch</function> returns row data using the variables bound by <function>mysqli_stmt_bind_result</function>. </para> <note> <para> Note that all columns must be bound by the application before calling <function>mysqli_stmt_fetch</function>. </para> </note> </refsect1> <refsect1> <title>Return values</title> <table> <title>Return values</title> <tgroup cols='2'> <thead> <row> <entry>Value</entry> <entry>Description</entry> </row> </thead> <tbody> <row> <entry>&true;</entry> <entry>Success. Data has been fetched</entry> </row> <row> <entry>&false;</entry> <entry>Error occured</entry> </row> <row> <entry><literal>&null;</literal></entry> <entry>No more rows/data exists</entry> </row> </tbody> </tgroup> </table> </refsect1> <refsect1> <title>See also</title> <para> <function>mysqli_prepare</function>, <function>mysqli_stmt_errno</function>, <function>mysqli_stmt_error</function>, <function>mysqli_stmt_bind_result</function> </para> </refsect1> <refsect1> <title>Example</title> <example> <title>Object oriented style</title> <programlisting role="php"> <![CDATA[ <?php $mysqli = new mysqli("localhost", "my_user", "my_password", "world"); /* check connection */ if (mysqli_connect_errno()) { printf("Connect failed: %s\n", mysqli_connect_error()); exit(); } $query = "SELECT Name, CountryCode FROM City ORDER by ID DESC LIMIT 150,5"; if ($stmt = $mysqli->prepare($query)) { /* execute statement */ $stmt->execute(); /* bind result variables */ $stmt->bind_result($name, $code); /* fetch values */ while ($stmt->fetch()) { printf ("%s (%s)\n", $name, $code); } /* close statement */ $stmt->close(); } /* close connection */ $mysqli->close(); ?> ]]> </programlisting> </example> <example> <title>Procedural style</title> <programlisting role="php"> <![CDATA[ <?php $link = mysqli_connect("localhost", "my_user", "my_password", "world"); /* check connection */ if (mysqli_connect_errno()) { printf("Connect failed: %s\n", mysqli_connect_error()); exit(); } $query = "SELECT Name, CountryCode FROM City ORDER by ID DESC LIMIT 150,5"; if ($stmt = mysqli_prepare($link, $query)) { /* execute statement */ mysqli_stmt_execute($stmt); /* bind result variables */ mysqli_stmt_bind_result($stmt, $name, $code); /* fetch values */ while (mysqli_stmt_fetch($stmt)) { printf ("%s (%s)\n", $name, $code); } /* close statement */ mysqli_stmt_close($stmt); } /* close connection */ mysqli_close($link); ?> ]]> </programlisting> </example> <para> The above examples would produce the following output: </para> <screen> <![CDATA[ Rockford (USA) Tallahassee (USA) Salinas (USA) Santa Clarita (USA) Springfield (USA) ]]> </screen> </refsect1> </refentry> <!-- Keep this comment at the end of the file Local variables: mode: sgml sgml-omittag:t sgml-shorttag:t sgml-minimize-attributes:nil sgml-always-quote-attributes:t sgml-indent-step:1 sgml-indent-data:t indent-tabs-mode:nil sgml-parent-document:nil sgml-default-dtd-file:"../../../../manual.ced" sgml-exposed-tags:nil sgml-local-catalogs:nil sgml-local-ecat-files:nil End: vim600: syn=xml fen fdm=syntax fdl=2 si vim: et tw=78 syn=sgml vi: ts=1 sw=1 --> http://cvs.php.net/co.php/phpdoc/en/reference/mysqli/functions/mysqli-stmt-init.xml?r=1.1&p=1 Index: phpdoc/en/reference/mysqli/functions/mysqli-stmt-init.xml +++ phpdoc/en/reference/mysqli/functions/mysqli-stmt-init.xml <?xml version="1.0" encoding="iso-8859-1"?> <!-- $Revision: 1.1 $ --> <refentry id="function.mysqli-stmt-init"> <refnamediv> <refname>mysqli_stmt-init</refname> <refpurpose> Initializes a statement and returns an object for use with mysqli_stmt_prepare </refpurpose> </refnamediv> <refsect1> <title>Description</title> <methodsynopsis> <type>object</type><methodname>mysqli_stmt_init</methodname> <void/> </methodsynopsis> <para> Allocates and initializes a statement object suitable for <function>mysqli_stmt_prepare</function>. </para> <note> <para> Any subsequent calls to any mysqli_stmt function will fail until <function>mysqli_stmt_prepare</function> was called. </para> </note> </refsect1> <refsect1> &reftitle.returnvalues; <para> Returns an object. </para> </refsect1> <refsect1> &reftitle.seealso; <para> <function>mysqli_stmt_prepare</function> </para> </refsect1> </refentry> <!-- Keep this comment at the end of the file Local variables: mode: sgml sgml-omittag:t sgml-shorttag:t sgml-minimize-attributes:nil sgml-always-quote-attributes:t sgml-indent-step:1 sgml-indent-data:t indent-tabs-mode:nil sgml-parent-document:nil sgml-default-dtd-file:"../../../../manual.ced" sgml-exposed-tags:nil sgml-local-catalogs:nil sgml-local-ecat-files:nil End: vim600: syn=xml fen fdm=syntax fdl=2 si vim: et tw=78 syn=sgml vi: ts=1 sw=1 --> http://cvs.php.net/co.php/phpdoc/en/reference/mysqli/functions/mysqli-stmt-param-count.xml?r=1.1&p=1 Index: phpdoc/en/reference/mysqli/functions/mysqli-stmt-param-count.xml +++ phpdoc/en/reference/mysqli/functions/mysqli-stmt-param-count.xml <?xml version="1.0" encoding="iso-8859-1"?> <!-- $Revision: 1.1 $ --> <refentry id="function.mysqli-stmt-param-count"> <refnamediv> <refname>mysqli_stmt_param_count</refname> <refname>stmt->param_count</refname> <refpurpose>Returns the number of parameter for the given statement</refpurpose> </refnamediv> <refsect1> <title>Description</title> <para>Procedural style:</para> <methodsynopsis> <type>int</type><methodname>mysqli_stmt_param_count</methodname> <methodparam><type>object</type><parameter>stmt</parameter></methodparam> </methodsynopsis> <para>Object oriented style (property):</para> <classsynopsis> <ooclass><classname>stmt</classname></ooclass> <fieldsynopsis><type>int</type><varname>param_count</varname></fieldsynopsis> </classsynopsis> <para> <function>mysqli_stmt_param_count</function> returns the number of parameter markers present in the prepared statement. </para> </refsect1> <refsect1> &reftitle.returnvalues; <para> returns an integer representing the number of parameters. </para> </refsect1> <refsect1> &reftitle.seealso; <para> <function>mysqli_prepare</function> </para> </refsect1> <refsect1> <title>Example</title> <example> <title>Object oriented style</title> <programlisting role="php"> <![CDATA[ <?php $mysqli = new mysqli("localhost", "my_user", "my_password", "world"); /* check connection */ if (mysqli_connect_errno()) { printf("Connect failed: %s\n", mysqli_connect_error()); exit(); } if ($stmt = $mysqli->prepare("SELECT Name FROM Country WHERE Name=? OR Code=?")) { $marker = $stmt->param_count; printf("Statement has %d markers.\n", $marker); /* close statement */ $stmt->close(); } /* close connection */ $mysqli->close(); ?> ]]> </programlisting> </example> <example> <title>Procedural style</title> <programlisting role="php"> <![CDATA[ <?php $link = mysqli_connect("localhost", "my_user", "my_password", "world"); /* check connection */ if (mysqli_connect_errno()) { printf("Connect failed: %s\n", mysqli_connect_error()); exit(); } if ($stmt = mysqli_prepare($link, "SELECT Name FROM Country WHERE Name=? OR Code=?")) { $marker = mysqli_stmt_param_count($stmt); printf("Statement has %d markers.\n", $marker); /* close statement */ mysqli_stmt_close($stmt); } /* close connection */ mysqli_close($link); ?> ]]> </programlisting> </example> <para> The above examples would produce the following output: </para> <screen> <![CDATA[ Statement has 2 markers. ]]> </screen> </refsect1> </refentry> <!-- Keep this comment at the end of the file Local variables: mode: sgml sgml-omittag:t sgml-shorttag:t sgml-minimize-attributes:nil sgml-always-quote-attributes:t sgml-indent-step:1 sgml-indent-data:t indent-tabs-mode:nil sgml-parent-document:nil sgml-default-dtd-file:"../../../../manual.ced" sgml-exposed-tags:nil sgml-local-catalogs:nil sgml-local-ecat-files:nil End: vim600: syn=xml fen fdm=syntax fdl=2 si vim: et tw=78 syn=sgml vi: ts=1 sw=1 --> http://cvs.php.net/co.php/phpdoc/en/reference/mysqli/functions/mysqli-stmt-prepare.xml?r=1.1&p=1 Index: phpdoc/en/reference/mysqli/functions/mysqli-stmt-prepare.xml +++ phpdoc/en/reference/mysqli/functions/mysqli-stmt-prepare.xml <?xml version="1.0" encoding="iso-8859-1"?> <!-- $Revision: 1.1 $ --> <refentry id="function.mysqli-stmt-prepare"> <refnamediv> <refname>mysqli_stmt_prepare</refname> <refname>stmt->prepare</refname> <refpurpose> Prepare a SQL statement for execution </refpurpose> </refnamediv> <refsect1> <title>Description</title> <para>Procedure style:</para> <methodsynopsis> <type>bool</type><methodname>mysqli_stmt_prepare</methodname> <methodparam><type>object</type><parameter>stmt</parameter></methodparam> <methodparam><type>string</type><parameter>query</parameter></methodparam> </methodsynopsis> <para>Object oriented style (method)</para> <classsynopsis> <ooclass><classname>stmt</classname></ooclass> <methodsynopsis> <type>mixed</type> <methodname>prepare</methodname> <methodparam><type>string</type><parameter>query</parameter></methodparam> </methodsynopsis> </classsynopsis> <para> <function>mysqli_stmt_prepare</function> prepares the SQL query pointed to by the null-terminated string query. The statement object has to be allocated by <function>mysqli_stmt_init</function>. The query must consist of a single SQL statement. </para> <note> <para> You should not add a terminating semicolon or <literal>\g</literal> to the statement. </para> </note> <para> The parameter <parameter>query</parameter> can include one or more parameter markers in the SQL statement by embedding question mark (<literal>?</literal>) characters at the appropriate positions. </para> <note> <para> The markers are legal only in certain places in SQL statements. For example, they are allowed in the VALUES() list of an INSERT statement (to specify column values for a row), or in a comparison with a column in a WHERE clause to specify a comparison value. </para> <para> However, they are not allowed for identifiers (such as table or column names), in the select list that names the columns to be returned by a SELECT statement), or to specify both operands of a binary operator such as the <literal>=</literal> equal sign. The latter restriction is necessary because it would be impossible to determine the parameter type. In general, parameters are legal only in Data Manipulation Languange (DML) statements, and not in Data Defination Language (DDL) statements. </para> </note> <para> The parameter markers must be bound to application variables using <function>mysqli_stmt_bind_param</function> and/or <function>mysqli_stmt_bind_result</function> before executing the statement or fetching rows. </para> </refsect1> <refsect1> &reftitle.returnvalues; <para> &return.success; </para> </refsect1> <refsect1> &reftitle.seealso; <para> <function>mysqli_stmt_init</function>, <function>mysqli_stmt_execute</function>, <function>mysqli_stmt_fetch</function>, <function>mysqli_stmt_bind_param</function>, <function>mysqli_stmt_bind_result</function>, <function>mysqli_stmt_close</function> </para> </refsect1> <refsect1> <title>Example</title> <example> <title>Object oriented style</title> <programlisting role="php"> <![CDATA[ <?php $mysqli = new mysqli("localhost", "my_user", "my_password", "world"); /* check connection */ if (mysqli_connect_errno()) { printf("Connect failed: %s\n", mysqli_connect_error()); exit(); } $city = "Amersfoort"; /* create a prepared statement */ $stmt = $mysqli->stmt_init(); if ($stmt->prepare("SELECT District FROM City WHERE Name=?")) { /* bind parameters for markers */ $stmt->bind_param("s", $city); /* execute query */ $stmt->execute(); /* bind result variables */ $stmt->bind_result($district); /* fetch value */ $stmt->fetch(); printf("%s is in district %s\n", $city, $district); /* close statement */ $stmt->close(); } /* close connection */ $mysqli->close(); ?> ]]> </programlisting> </example> <example> <title>Procedural style</title> <programlisting role="php"> <![CDATA[ <?php $link = mysqli_connect("localhost", "my_user", "my_password", "world"); /* check connection */ if (mysqli_connect_errno()) { printf("Connect failed: %s\n", mysqli_connect_error()); exit(); } $city = "Amersfoort"; /* create a prepared statement */ $stmt = mysqli_stmt_init(); if ($stmt = mysqli_stmt_prepare($stmt, "SELECT District FROM City WHERE Name=?")) { /* bind parameters for markers */ mysqli_stmt_bind_param($stmt, "s", $city); /* execute query */ mysqli_stmt_execute($stmt); /* bind result variables */ mysqli_stmt_bind_result($stmt, $district); /* fetch value */ mysqli_stmt_fetch($stmt); printf("%s is in district %s\n", $city, $district); /* close statement */ mysqli_stmt_close($stmt); } /* close connection */ mysqli_close($link); ?> ]]> </programlisting> </example> <para> The above examples would produce the following output: </para> <screen> <![CDATA[ Amersfoort is in district Utrecht ]]> </screen> </refsect1> </refentry> <!-- Keep this comment at the end of the file Local variables: mode: sgml sgml-omittag:t sgml-shorttag:t sgml-minimize-attributes:nil sgml-always-quote-attributes:t sgml-indent-step:1 sgml-indent-data:t indent-tabs-mode:nil sgml-parent-document:nil sgml-default-dtd-file:"../../../../manual.ced" sgml-exposed-tags:nil sgml-local-catalogs:nil sgml-local-ecat-files:nil End: vim600: syn=xml fen fdm=syntax fdl=2 si vim: et tw=78 syn=sgml vi: ts=1 sw=1 --> http://cvs.php.net/co.php/phpdoc/en/reference/mysqli/functions/mysqli-stmt-result-metadata.xml?r=1.1&p=1 Index: phpdoc/en/reference/mysqli/functions/mysqli-stmt-result-metadata.xml +++ phpdoc/en/reference/mysqli/functions/mysqli-stmt-result-metadata.xml <?xml version="1.0" encoding="iso-8859-1"?> <!-- $Revision: 1.1 $ --> <refentry id="function.mysqli-stmt-result-metadata"> <refnamediv> <refname>mysqli_stmt_result_metadata</refname> <refpurpose>returns result set metadata from a prepared statement</refpurpose> </refnamediv> <refsect1> <title>Description</title> <para>Procedural style:</para> <methodsynopsis> <type>mixed</type><methodname>mysqli_stmt_result_metadata</methodname> <methodparam><type>object</type><parameter>stmt</parameter></methodparam> </methodsynopsis> <para>Object oriented style (method):</para> <classsynopsis> <ooclass><classname>stmt</classname></ooclass> <methodsynopsis> <type>mixed</type> <methodname>get_metadata</methodname> <methodparam><type>void</type><parameter></parameter></methodparam> </methodsynopsis> </classsynopsis> <para> If a statement passed to <function>mysqli_prepare</function> is one that produces a result set, <function>mysqli_stmt_result_metadata</function> returns the result object that can be used to process the meta information such as total number of fields and individual field information. </para> <note> <para>This result set pointer can be passed as an argument to any of the field-based functions that process result set metadata, such as: <itemizedlist> <listitem><para><function>mysqli_num_fields</function></para></listitem> <listitem><para><function>mysqli_fetch_field</function></para></listitem> <listitem><para><function>mysqli_fetch_field_direct</function></para></listitem> <listitem><para><function>mysqli_fetch_fields</function></para></listitem> <listitem><para><function>mysqli_field_count</function></para></listitem> <listitem><para><function>mysqli_field_seek</function></para></listitem> <listitem><para><function>mysqli_field_tell</function></para></listitem> <listitem><para><function>mysqli_free_result</function></para></listitem> </itemizedlist> </para> </note> <para> The result set structure should be freed when you are done with it, which you can do by passing it to <function>mysqli_free_result</function> </para> <note> <para> The result set returned by <function>mysqli_stmt_result_metadata</function> contains only metadata. It does not contain any row results. The rows are obtained by using the statement handle with <function>mysqli_fetch</function>. </para> </note> </refsect1> <refsect1> &reftitle.returnvalues; <para> <function>mysqli_stmt_result_metadata</function> returns a result object or &false; if an error occured. </para> </refsect1> <refsect1> <title>See also:</title> <para> <function>mysqli_prepare</function>, <function>mysqli_free_result</function> </para> </refsect1> <refsect1> <title>Example</title> <para> <example> <title>Object oriented style</title> <programlisting role='php'> <![CDATA[ <?php $mysqli = new mysqli("localhost", "my_user", "my_password", "test"); $mysqli->query("DROP TABLE IF EXISTS friends"); $mysqli->query("CREATE TABLE friends (id int, name varchar(20))"); $mysqli->query("INSERT INTO friends VALUES (1,'Hartmut'), (2, 'Ulf')"); $stmt = $mysqli->prepare("SELECT id, name FROM friends"); $stmt->execute(); /* get resultset for metadata */ $result = $stmt->get_metadata(); /* retrieve field information from metadata result set */ $field = $result->fetch_field(); printf("Fieldname: %s\n", $field->name); /* close resultset */ $result->close(); /* close connection */ $mysqli->close(); ?> ]]> </programlisting> </example> <example> <title>Procedural style</title> <programlisting role='php'> <![CDATA[ <?php $link = mysqli_connect("localhost", "my_user", "my_password", "test"); mysqli_query($link, "DROP TABLE IF EXISTS friends"); mysqli_query($link, "CREATE TABLE friends (id int, name varchar(20))"); mysqli_query($link, "INSERT INTO friends VALUES (1,'Hartmut'), (2, 'Ulf')"); $stmt = mysqli_prepare($link, "SELECT id, name FROM friends"); mysqli_stmt_execute($stmt); /* get resultset for metadata */ $result = mysqli_stmt_result_metadata($stmt); /* retrieve field information from metadata result set */ $field = mysqli_fetch_field($result); printf("Fieldname: %s\n", $field->name); /* close resultset */ mysqli_free_result($result); /* close connection */ mysqli_close($link); ?> ]]> </programlisting> </example> </para> </refsect1> </refentry> <!-- Keep this comment at the end of the file Local variables: mode: sgml sgml-omittag:t sgml-shorttag:t sgml-minimize-attributes:nil sgml-always-quote-attributes:t sgml-indent-step:1 sgml-indent-data:t indent-tabs-mode:nil sgml-parent-document:nil sgml-default-dtd-file:"../../../../manual.ced" sgml-exposed-tags:nil sgml-local-catalogs:nil sgml-local-ecat-files:nil End: vim600: syn=xml fen fdm=syntax fdl=2 si vim: et tw=78 syn=sgml vi: ts=1 sw=1 --> http://cvs.php.net/co.php/phpdoc/en/reference/mysqli/functions/mysqli-stmt-send-long-data.xml?r=1.1&p=1 Index: phpdoc/en/reference/mysqli/functions/mysqli-stmt-send-long-data.xml +++ phpdoc/en/reference/mysqli/functions/mysqli-stmt-send-long-data.xml <?xml version="1.0" encoding="iso-8859-1"?> <!-- $Revision: 1.1 $ --> <refentry id="function.mysqli-stmt-send-long-data"> <refnamediv> <refname>mysqli_stmt_send_long_data</refname> <refname>stmt->send_long_data</refname> <refpurpose>Send data in blocks</refpurpose> </refnamediv> <refsect1> <title>Description</title> <para>Procedural style:</para> <methodsynopsis> <type>bool</type><methodname>mysqli_stmt_send_long_data</methodname> <methodparam><type>object</type><parameter>stmt</parameter></methodparam> <methodparam><type>int</type><parameter>param_nr</parameter></methodparam> <methodparam><type>string</type><parameter>data</parameter></methodparam> </methodsynopsis> <para>Object oriented style (method)</para> <classsynopsis> <ooclass><classname>stmt</classname></ooclass> <methodsynopsis> <type>bool</type><methodname>stmt_send_long_data</methodname> <methodparam><type>int</type><parameter>param_nr</parameter></methodparam> <methodparam><type>string</type><parameter>data</parameter></methodparam> </methodsynopsis> </classsynopsis> <para> Allows to send parameter data to the server in pieces (or chunks), e.g. if the size of a blob exceeds the size of <literal>max_allowed_packet</literal>. This function can be called multiple times to send the parts of a character or binary data value for a column, which must be one of the TEXT or BLOB datatypes. </para> <para> <parameter>param_nr</parameter> indicates which parameter to associate the data with. Parameters are numbered beginning with 0. data is a string containing data to be sent. </para> </refsect1> <refsect1> <title>Return values</title> <para>&return.success;</para> </refsect1> <refsect1> <title>See also</title> <para> <function>mysqli_prepare</function>, <function>mysqli_stmt_bind_param</function> </para> </refsect1> </refentry> <!-- Keep this comment at the end of the file Local variables: mode: sgml sgml-omittag:t sgml-shorttag:t sgml-minimize-attributes:nil sgml-always-quote-attributes:t sgml-indent-step:1 sgml-indent-data:t indent-tabs-mode:nil sgml-parent-document:nil sgml-default-dtd-file:"../../../../manual.ced" sgml-exposed-tags:nil sgml-local-catalogs:nil sgml-local-ecat-files:nil End: vim600: syn=xml fen fdm=syntax fdl=2 si vim: et tw=78 syn=sgml vi: ts=1 sw=1 -->
http://cvs.php.net/diff.php/phpdoc/en/reference/mysqli/functions/mysqli-bind-param.xml?r1=1.7&r2=1.8&ty=u Index: phpdoc/en/reference/mysqli/functions/mysqli-bind-param.xml diff -u phpdoc/en/reference/mysqli/functions/mysqli-bind-param.xml:1.7 phpdoc/en/reference/mysqli/functions/mysqli-bind-param.xml:1.8 --- phpdoc/en/reference/mysqli/functions/mysqli-bind-param.xml:1.7 Wed Feb 25 16:59:16 2004 +++ phpdoc/en/reference/mysqli/functions/mysqli-bind-param.xml Tue Mar 9 12:21:48 2004 @@ -1,189 +1,29 @@ <?xml version="1.0" encoding="iso-8859-1"?> -<!-- $Revision: 1.7 $ --> +<!-- $Revision: 1.8 $ --> <refentry id="function.mysqli-bind-param"> <refnamediv> <refname>mysqli_bind_param</refname> - <refname>stmt->bind_param</refname> - <refpurpose>Binds variables to a prepared statement as parameters</refpurpose> + <refpurpose>Alias for <function>mysqli_stmt_bind_param</function></refpurpose> </refnamediv> <refsect1> <title>Description</title> - <para>Procedural style:</para> - <methodsynopsis> - <type>bool</type><methodname>mysqli_bind_param</methodname> - <methodparam><type>object</type><parameter>stmt</parameter></methodparam> - <methodparam><type>string</type><parameter>types</parameter></methodparam> - <methodparam><type>mixed</type><parameter>var1</parameter></methodparam> - <methodparam choice="opt"><type>mixed</type><parameter>var2, ...</parameter></methodparam> - </methodsynopsis> - <para>Object oriented style (method):</para> - <classsynopsis> - <ooclass><classname>stmt</classname></ooclass> - <methodsynopsis> - <type>bool</type> - <methodname>bind_param</methodname> - <methodparam><type>array</type><parameter>types</parameter></methodparam> - <methodparam><type>mixed</type><parameter>var1</parameter></methodparam> - <methodparam choice="opt"><type>mixed</type><parameter>var2, ...</parameter></methodparam> - </methodsynopsis> - </classsynopsis> <para> - <function>mysql_bind_param</function> is used to bind variables for the - parameter markers in the SQL statement that was passed to - <function>mysql_prepare</function>. - The string <parameter>types</parameter> contains one or more characters which specify - the types for the corresponding bind variables - <table> - <title>Type specification chars</title> - <tgroup cols='2'> - <thead> - <row> - <entry>Character</entry> - <entry>Description</entry> - </row> - </thead> - <tbody> - <row> - <entry>i</entry> - <entry>corresponding variable has type integer</entry> - </row> - <row> - <entry>d</entry> - <entry>corresponding variable has type double</entry> - </row> - <row> - <entry>s</entry> - <entry>corresponding variable has type string</entry> - </row> - <row> - <entry>b</entry> - <entry>corresponding variable is a blob and will be send in packages</entry> - </row> - </tbody> - </tgroup> - </table> + This function is an alias of <function>mysqli_stmt_bind_param</function>. + For a detailled descripton see description of + <function>mysqli_stmt_bind_param</function>. </para> <note> - <para> - If data size of a variable exceeds max. allowed package size - (max_allowed_package), you have to specify <literal>b</literal> in - <parameter>types</parameter> and use - <function>mysqli_send_long_data</function> to send the data in packages. - </para> - <para> - The number of variables and length of - string <parameter>types</parameter> must match the parameters in the statement. + <para> + <function>mysqli_bind_param</function> is deprecated and will be removed. </para> </note> </refsect1> <refsect1> - <title>Return values</title> + <title>See also</title> <para> - &return.success; + <function>mysqli_stmt_bind_param</function> </para> </refsect1> - <refsect1> - <title>See also</title> - <para> - <function>mysqli_bind_result</function>, - <function>mysqli_execute</function>, - <function>mysqli_fetch</function>, - <function>mysqli_prepare</function>, - <function>mysqli_send_long_data</function>, - <function>mysqli_stmt_errno</function>, - <function>mysqli_stmt_error</function> - </para> - </refsect1> - <refsect1> - <title>Example</title> - <example> - <title>Object oriented style</title> - <programlisting role="php"> -<![CDATA[ -<?php -$mysqli = new mysqli('localhost', 'my_user', 'my_password', 'world'); - -/* check connection */ -if (mysqli_connect_errno()) { - printf("Connect failed: %s\n", mysqli_connect_error()); - exit(); -} - -$stmt = $mysqli->prepare("INSERT INTO CountryLanguage VALUES (?, ?, ?, ?)"); -$stmt->bind_param('sssd', $code, $language, $official, $percent); - -$code = 'DEU'; -$language = 'Bavarian'; -$official = "F"; -$percent = 11.2; - -/* execute prepared statement */ -$stmt->execute(); - -printf("%d Row inserted.\n", $stmt->affected_rows); - -/* close statement and connection */ -$stmt->close(); - -/* Clean up table CountryLanguage */ -$mysqli->query("DELETE FROM CountryLanguage WHERE Language='Bavarian'"); -printf("%d Row deleted.\n", $mysqli->affected_rows); - -/* close connection */ -$mysqli->close(); -?> -]]> - </programlisting> - </example> - <example> - <title>Procedural style</title> - <programlisting role="php"> -<![CDATA[ -<?php -$link = mysqli_connect('localhost', 'my_user', 'my_password', 'world'); - -/* check connection */ -if (!$link) { - printf("Connect failed: %s\n", mysqli_connect_error()); - exit(); -} - -$stmt = mysqli_prepare($link, "INSERT INTO CountryLanguage VALUES (?, ?, ?, ?)"); -mysqli_bind_param($stmt, 'sssd', $code, $language, $official, $percent); - -$code = 'DEU'; -$language = 'Bavarian'; -$official = "F"; -$percent = 11.2; - -/* execute prepared statement */ -mysqli_execute($stmt); - -printf("%d Row inserted.\n", mysqli_stmt_affected_rows($stmt)); - -/* close statement and connection */ -mysqli_stmt_close($stmt); - -/* Clean up table CountryLanguage */ -mysqli_query($link, "DELETE FROM CountryLanguage WHERE Language='Bavarian'"); -printf("%d Row deleted.\n", mysqli_affected_rows($link)); - -/* close connection */ -mysqli_close($link); -?> -]]> - </programlisting> - </example> - <para> - The above examples would produce the following output: - </para> - <screen> -<![CDATA[ -1 Row inserted. -1 Row deleted. -]]> - </screen> - </refsect1> </refentry> <!-- Keep this comment at the end of the file http://cvs.php.net/diff.php/phpdoc/en/reference/mysqli/functions/mysqli-bind-result.xml?r1=1.4&r2=1.5&ty=u Index: phpdoc/en/reference/mysqli/functions/mysqli-bind-result.xml diff -u phpdoc/en/reference/mysqli/functions/mysqli-bind-result.xml:1.4 phpdoc/en/reference/mysqli/functions/mysqli-bind-result.xml:1.5 --- phpdoc/en/reference/mysqli/functions/mysqli-bind-result.xml:1.4 Wed Feb 25 16:59:16 2004 +++ phpdoc/en/reference/mysqli/functions/mysqli-bind-result.xml Tue Mar 9 12:21:48 2004 @@ -1,148 +1,28 @@ <?xml version="1.0" encoding="iso-8859-1"?> -<!-- $Revision: 1.4 $ --> +<!-- $Revision: 1.5 $ --> <refentry id="function.mysqli-bind-result"> <refnamediv> <refname>mysqli_bind_result</refname> - <refname>stmt->bind_result</refname> - <refpurpose>Binds variables to a prepared statement for result storage</refpurpose> + <refpurpose>Alias for <function>mysqli_stmt_bind_result</function></refpurpose> </refnamediv> <refsect1> <title>Description</title> - <para>Procedural style:</para> - <methodsynopsis> - <type>bool</type><methodname>mysqli_bind_result</methodname> - <methodparam><type>object</type><parameter>stmt</parameter></methodparam> - <methodparam><type>mixed</type><parameter>var1</parameter></methodparam> - <methodparam choice="opt"><type>mixed</type><parameter>var2, ...</parameter></methodparam> - </methodsynopsis> - <para>Object oriented style (method):</para> - <classsynopsis> - <ooclass><classname>stmt</classname></ooclass> - <methodsynopsis> - <type>bool</type> - <methodname>bind_result</methodname> - <methodparam><type>mixed</type><parameter>var1</parameter></methodparam> - <methodparam choice="opt"><type>mixed</type><parameter>var2, ...</parameter></methodparam> - </methodsynopsis> - </classsynopsis> - <para> - <function>mysqli_bind_result</function> is used to associate (bind) columns in the result - set to variables. When <function>mysqli_fetch</function> is called to fetch data, the MySQL - client/server protocol places the data for the bound columns into the specified variables - <parameter>var1, ...</parameter>. - </para> - <note> - <para> - Note that all columns must be bound prior to calling <function>mysqli_fetch</function>. - Depending on column types bound variables can silently change to the corresponding PHP type. - </para> - <para> - A column can be bound or rebound at any time, even after a result set has been partially retrieved. - The new binding takes effect the next time <function>mysqli_fetch</function> is called. - </para> - </note> - </refsect1> - <refsect1> - <title>Return values</title> <para> - &return.success; + This function is an alias of <function>mysqli_stmt_bind_result</function>. + For a detailled descripton see description of + <function>mysqli_stmt_bind_result</function>. </para> + <note> + <para> + <function>mysqli_bind_result</function> is deprecated and will be removed. + </para> + </note> </refsect1> <refsect1> <title>See also</title> <para> - <function>mysqli_bind_param</function>, - <function>mysqli_execute</function>, - <function>mysqli_fetch</function>, -<!-- <function>mysqli_fetch_column</function> --> - <function>mysqli_prepare</function>, - <function>mysqli_stmt_errno</function>, - <function>mysqli_stmt_error</function> - </para> - </refsect1> - <refsect1> - <title>Example</title> - <example> - <title>Object oriented style</title> - <programlisting role="php"> -<![CDATA[ -<?php -$mysqli = new mysqli("localhost", "my_user", "my_password", "world"); - -if (mysqli_connect_errno()) { - printf("Connect failed: %s\n", mysqli_connect_error()); - exit(); -} - -/* prepare statement */ -if ($stmt = $mysqli->prepare("SELECT Code, Name FROM Country ORDER BY Name LIMIT 5")) { - $stmt->execute(); - - /* bind variables to prepared statement */ - $stmt->bind_result($col1, $col2); - - /* fetch values */ - while ($stmt->fetch()) { - printf("%s %s\n", $col1, $col2); - } - - /* close statement */ - $stmt->close(); -} -/* close connection */ -$mysqli->close(); - -?> -]]> - </programlisting> - </example> - <example> - <title>Procedural style</title> - <programlisting role="php"> -<![CDATA[ -<?php -$link = mysqli_connect("localhost", "my_user", "my_password", "world"); - -/* check connection */ -if (!$link) { - printf("Connect failed: %s\n", mysqli_connect_error()); - exit(); -} - -/* prepare statement */ -if ($stmt = mysqli_prepare($link, "SELECT Code, Name FROM Country ORDER BY Name LIMIT 5")) { - mysqli_execute($stmt); - - /* bind variables to prepared statement */ - mysqli_bind_result($stmt, $col1, $col2); - - /* fetch values */ - while (mysqli_fetch($stmt)) { - printf("%s %s\n", $col1, $col2); - } - - /* close statement */ - mysqli_stmt_close($stmt); -} - -/* close connection */ -mysqli_close($link); -?> -]]> - </programlisting> - </example> - <para> - The above examples would produce the following output: + <function>mysqli_stmt_bind_result</function> </para> - <screen> -<![CDATA[ -AFG Afghanistan -ALB Albania -DZA Algeria -ASM American Samoa -AND Andorra -]]> - </screen> </refsect1> </refentry> http://cvs.php.net/diff.php/phpdoc/en/reference/mysqli/functions/mysqli-execute.xml?r1=1.10&r2=1.11&ty=u Index: phpdoc/en/reference/mysqli/functions/mysqli-execute.xml diff -u phpdoc/en/reference/mysqli/functions/mysqli-execute.xml:1.10 phpdoc/en/reference/mysqli/functions/mysqli-execute.xml:1.11 --- phpdoc/en/reference/mysqli/functions/mysqli-execute.xml:1.10 Wed Feb 25 16:59:16 2004 +++ phpdoc/en/reference/mysqli/functions/mysqli-execute.xml Tue Mar 9 12:21:48 2004 @@ -1,181 +1,28 @@ <?xml version="1.0" encoding="iso-8859-1"?> -<!-- $Revision: 1.10 $ --> +<!-- $Revision: 1.11 $ --> <refentry id="function.mysqli-execute"> <refnamediv> <refname>mysqli_execute</refname> - <refname>stmt->execute</refname> - <refpurpose>Executes a prepared Query</refpurpose> + <refpurpose>Alias for <function>mysqli_stmt_execute</function></refpurpose> </refnamediv> <refsect1> <title>Description</title> - <para>Procedural style:</para> - <methodsynopsis> - <type>bool</type><methodname>mysqli_execute</methodname> - <methodparam><type>object</type><parameter>stmt</parameter></methodparam> - </methodsynopsis> - <para>Object oriented style (method):</para> - <classsynopsis> - <ooclass><classname>mysql</classname></ooclass> - <methodsynopsis> - <type>bool</type> - <methodname>execute</methodname> - <methodparam><type>void</type><parameter></parameter></methodparam> - </methodsynopsis> - </classsynopsis> <para> - 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> object. 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. + This function is an alias of <function>mysqli_stmt_execute</function>. + For a detailled descripton see description of + <function>mysqli_stmt_execute</function>. </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. + <function>mysqli_execute</function> is deprecated and will be removed. </para> </note> </refsect1> <refsect1> - <title>Return values</title> - <para>&return.success;</para> - </refsect1> - <refsect1> <title>See also</title> <para> - <function>mysqli_prepare</function> - <function>mysqli_bind_param</function>. - </para> - </refsect1> - <refsect1> - <title>Example</title> - <example> - <title>Object oriented style</title> - <programlisting role="php"> -<![CDATA[ -<?php -$mysqli = new mysqli("localhost", "my_user", "my_password", "world"); - -/* check connection */ -if (mysqli_connect_errno()) { - printf("Connect failed: %s\n", mysqli_connect_error()); - exit(); -} - -$mysqli->query("CREATE TABLE myCity LIKE City"); - -/* Prepare an insert statement */ -$query = "INSERT INTO myCity (Name, CountryCode, District) VALUES (?,?,?)"; -$stmt = $mysqli->prepare($query); - -$stmt->bind_param("sss", $val1, $val2, $val3); - -$val1 = 'Stuttgart'; -$val2 = 'DEU'; -$val3 = 'Baden-Wuerttemberg'; - -/* Execute the statement */ -$stmt->execute(); - -$val1 = 'Bordeaux'; -$val2 = 'FRA'; -$val3 = 'Aquitaine'; - -/* Execute the statement */ -$stmt->execute(); - -/* close statement */ -$stmt->close(); - -/* retrieve all rows from myCity */ -$query = "SELECT Name, CountryCode, District FROM myCity"; -if ($result = $mysqli->query($query)) { - while ($row = $result->fetch_row()) { - printf("%s (%s,%s)\n", $row[0], $row[1], $row[2]); - } - /* free result set */ - $result->close(); -} - -/* remove table */ -$mysqli->query("DROP TABLE myCity"); - -/* close connection */ -$mysqli->close(); -?> -]]> - </programlisting> - </example> - <example> - <title>Procedural style</title> - <programlisting role="php"> -<![CDATA[ -<?php -$link = mysqli_connect("localhost", "my_user", "my_password", "world"); - -/* check connection */ -if (mysqli_connect_errno()) { - printf("Connect failed: %s\n", mysqli_connect_error()); - exit(); -} - -mysqli_query($link, "CREATE TABLE myCity LIKE City"); - -/* Prepare an insert statement */ -$query = "INSERT INTO myCity (Name, CountryCode, District) VALUES (?,?,?)"; -$stmt = mysqli_prepare($link, $query); - -mysqli_bind_param($stmt, "sss", $val1, $val2, $val3); - -$val1 = 'Stuttgart'; -$val2 = 'DEU'; -$val3 = 'Baden-Wuerttemberg'; - -/* Execute the statement */ -mysqli_execute($stmt); - -$val1 = 'Bordeaux'; -$val2 = 'FRA'; -$val3 = 'Aquitaine'; - -/* Execute the statement */ -mysqli_execute($stmt); - -/* close statement */ -mysqli_stmt_close($stmt); - -/* retrieve all rows from myCity */ -$query = "SELECT Name, CountryCode, District FROM myCity"; -if ($result = mysqli_query($link, $query)) { - while ($row = mysqli_fetch_row($result)) { - printf("%s (%s,%s)\n", $row[0], $row[1], $row[2]); - } - /* free result set */ - mysqli_free_result($result); -} - -/* remove table */ -mysqli_query($link, "DROP TABLE myCity"); - -/* close connection */ -mysqli_close($link); -?> -]]> - </programlisting> - </example> - <para> - The above examples would produce the following output: + <function>mysqli_stmt_execute</function> </para> - <screen> -<![CDATA[ -Stuttgart (DEU,Baden-Wuerttemberg) -Bordeaux (FRA,Aquitaine) -]]> - </screen> </refsect1> </refentry> http://cvs.php.net/diff.php/phpdoc/en/reference/mysqli/functions/mysqli-fetch.xml?r1=1.6&r2=1.7&ty=u Index: phpdoc/en/reference/mysqli/functions/mysqli-fetch.xml diff -u phpdoc/en/reference/mysqli/functions/mysqli-fetch.xml:1.6 phpdoc/en/reference/mysqli/functions/mysqli-fetch.xml:1.7 --- phpdoc/en/reference/mysqli/functions/mysqli-fetch.xml:1.6 Wed Feb 25 16:59:16 2004 +++ phpdoc/en/reference/mysqli/functions/mysqli-fetch.xml Tue Mar 9 12:21:48 2004 @@ -1,165 +1,28 @@ <?xml version="1.0" encoding="iso-8859-1"?> -<!-- $Revision: 1.6 $ --> +<!-- $Revision: 1.7 $ --> <refentry id="function.mysqli-fetch"> <refnamediv> <refname>mysqli_fetch</refname> - <refname>stmt->fetch</refname> - <refpurpose> - Fetch results from a prepared statement into the bound variables - </refpurpose> + <refpurpose>Alias for <function>mysqli_stmt_fetch</function></refpurpose> </refnamediv> <refsect1> <title>Description</title> - <para>Procedural style:</para> - <methodsynopsis> - <type>mixed</type><methodname>mysqli_fetch</methodname> - <methodparam><type>object</type><parameter>stmt</parameter></methodparam> - </methodsynopsis> - <para>Object oriented style (method):</para> - <classsynopsis> - <ooclass><classname>stmt</classname></ooclass> - <methodsynopsis> - <type>mixed</type> - <methodname>fetch</methodname> - <methodparam><type>void</type><parameter></parameter></methodparam> - </methodsynopsis> - </classsynopsis> <para> - <function>mysqli_fetch</function> returns row data using the variables bound by <function>mysqli_bind_result</function>. + This function is an alias of <function>mysqli_stmt_fetch</function>. + For a detailled descripton see description of + <function>mysqli_stmt_fetch</function>. </para> <note> <para> - Note that all columns must be bound by the application before calling <function>mysqli_fetch</function>. + <function>mysqli_fetch</function> is deprecated and will be removed. </para> </note> </refsect1> <refsect1> - <title>Return values</title> - <table> - <title>Return values</title> - <tgroup cols='2'> - <thead> - <row> - <entry>Value</entry> - <entry>Description</entry> - </row> - </thead> - <tbody> - <row> - <entry>&true;</entry> - <entry>Success. Data has been fetched</entry> - </row> - <row> - <entry>&false;</entry> - <entry>Error occured</entry> - </row> - <row> - <entry><literal>&null;</literal></entry> - <entry>No more rows/data exists</entry> - </row> - </tbody> - </tgroup> - </table> - </refsect1> - <refsect1> <title>See also</title> <para> - <function>mysqli_prepare</function>, - <function>mysqli_stmt_errno</function>, - <function>mysqli_stmt_error</function>, - <function>mysqli_bind_result</function> - </para> - </refsect1> - <refsect1> - <title>Example</title> - <example> - <title>Object oriented style</title> - <programlisting role="php"> -<![CDATA[ -<?php -$mysqli = new mysqli("localhost", "my_user", "my_password", "world"); - -/* check connection */ -if (mysqli_connect_errno()) { - printf("Connect failed: %s\n", mysqli_connect_error()); - exit(); -} - -$query = "SELECT Name, CountryCode FROM City ORDER by ID DESC LIMIT 150,5"; - -if ($stmt = $mysqli->prepare($query)) { - - /* execute statement */ - $stmt->execute(); - - /* bind result variables */ - $stmt->bind_result($name, $code); - - /* fetch values */ - while ($stmt->fetch()) { - printf ("%s (%s)\n", $name, $code); - } - - /* close statement */ - $stmt->close(); -} - -/* close connection */ -$mysqli->close(); -?> -]]> - </programlisting> - </example> - <example> - <title>Procedural style</title> - <programlisting role="php"> -<![CDATA[ -<?php -$link = mysqli_connect("localhost", "my_user", "my_password", "world"); - -/* check connection */ -if (mysqli_connect_errno()) { - printf("Connect failed: %s\n", mysqli_connect_error()); - exit(); -} - -$query = "SELECT Name, CountryCode FROM City ORDER by ID DESC LIMIT 150,5"; - -if ($stmt = mysqli_prepare($link, $query)) { - - /* execute statement */ - mysqli_execute($stmt); - - /* bind result variables */ - mysqli_bind_result($stmt, $name, $code); - - /* fetch values */ - while (mysqli_fetch($stmt)) { - printf ("%s (%s)\n", $name, $code); - } - - /* close statement */ - mysqli_stmt_close($stmt); -} - -/* close connection */ -mysqli_close($link); -?> -]]> - </programlisting> - </example> - <para> - The above examples would produce the following output: + <function>mysqli_stmt_fetch</function> </para> - <screen> -<![CDATA[ -Rockford (USA) -Tallahassee (USA) -Salinas (USA) -Santa Clarita (USA) -Springfield (USA) -]]> - </screen> </refsect1> </refentry> http://cvs.php.net/diff.php/phpdoc/en/reference/mysqli/functions/mysqli-get-metadata.xml?r1=1.3&r2=1.4&ty=u Index: phpdoc/en/reference/mysqli/functions/mysqli-get-metadata.xml diff -u phpdoc/en/reference/mysqli/functions/mysqli-get-metadata.xml:1.3 phpdoc/en/reference/mysqli/functions/mysqli-get-metadata.xml:1.4 --- phpdoc/en/reference/mysqli/functions/mysqli-get-metadata.xml:1.3 Sun Feb 22 16:46:41 2004 +++ phpdoc/en/reference/mysqli/functions/mysqli-get-metadata.xml Tue Mar 9 12:21:48 2004 @@ -1,140 +1,27 @@ <?xml version="1.0" encoding="iso-8859-1"?> -<!-- $Revision: 1.3 $ --> +<!-- $Revision: 1.4 $ --> <refentry id="function.mysqli-get-metadata"> <refnamediv> <refname>mysqli_get_metadata</refname> - <refpurpose>returns result set metadata from a prepared statement</refpurpose> + <refpurpose>Alias for <function>mysqli_stmt_result_metadata</function></refpurpose> </refnamediv> <refsect1> <title>Description</title> - <para>Procedural style:</para> - <methodsynopsis> - <type>mixed</type><methodname>mysqli_get_metadata</methodname> - <methodparam><type>object</type><parameter>stmt</parameter></methodparam> - </methodsynopsis> - <para>Object oriented style (method):</para> - <classsynopsis> - <ooclass><classname>stmt</classname></ooclass> - <methodsynopsis> - <type>mixed</type> - <methodname>get_metadata</methodname> - <methodparam><type>void</type><parameter></parameter></methodparam> - </methodsynopsis> - </classsynopsis> <para> - If a statement passed to <function>mysqli_prepare</function> is one that produces - a result set, <function>mysqli_get_metadata</function> returns the result object - that can be used to process the meta information such as total number of fields - and individual field information. - </para> - <note> - <para>This result set pointer can be passed as an argument to any of the - field-based functions that process result set metadata, such as: - <itemizedlist> - <listitem><para><function>mysqli_num_fields</function></para></listitem> - <listitem><para><function>mysqli_fetch_field</function></para></listitem> - <listitem><para><function>mysqli_fetch_field_direct</function></para></listitem> - <listitem><para><function>mysqli_fetch_fields</function></para></listitem> - <listitem><para><function>mysqli_field_count</function></para></listitem> - <listitem><para><function>mysqli_field_seek</function></para></listitem> - <listitem><para><function>mysqli_field_tell</function></para></listitem> - <listitem><para><function>mysqli_free_result</function></para></listitem> - </itemizedlist> - </para> - </note> - <para> - The result set structure should be freed when you are done with it, - which you can do by passing it to <function>mysqli_free_result</function> + This function is an alias of <function>mysqli_stmt_result_metadata</function>. + For a detailled descripton see description of + <function>mysqli_stmt_result_metadata</function>. </para> <note> <para> - The result set returned by <function>mysqli_get_metadata</function> contains only - metadata. It does not contain any row results. The rows are obtained by using the - statement handle with <function>mysqli_fetch</function>. - </para> + <function>mysqli_get_metadata</function> is deprecated and will be removed. + </para> </note> </refsect1> <refsect1> - &reftitle.returnvalues; - <para> - <function>mysqli_get_metadata</function> returns a result object or &false; if - an error occured. - </para> - </refsect1> - <refsect1> - <title>See also:</title> - <para> - <function>mysqli_prepare</function>, - <function>mysqli_free_result</function> - </para> - </refsect1> - <refsect1> - <title>Example</title> + <title>See also</title> <para> - <example> - <title>Object oriented style</title> - <programlisting role='php'> -<![CDATA[ -<?php -$mysqli = new mysqli("localhost", "my_user", "my_password", "test"); - -$mysqli->query("DROP TABLE IF EXISTS friends"); -$mysqli->query("CREATE TABLE friends (id int, name varchar(20))"); - -$mysqli->query("INSERT INTO friends VALUES (1,'Hartmut'), (2, 'Ulf')"); - -$stmt = $mysqli->prepare("SELECT id, name FROM friends"); -$stmt->execute(); - -/* get resultset for metadata */ -$result = $stmt->get_metadata(); - -/* retrieve field information from metadata result set */ -$field = $result->fetch_field(); - -printf("Fieldname: %s\n", $field->name); - -/* close resultset */ -$result->close(); - -/* close connection */ -$mysqli->close(); -?> -]]> - </programlisting> - </example> - <example> - <title>Procedural style</title> - <programlisting role='php'> -<![CDATA[ -<?php -$link = mysqli_connect("localhost", "my_user", "my_password", "test"); - -mysqli_query($link, "DROP TABLE IF EXISTS friends"); -mysqli_query($link, "CREATE TABLE friends (id int, name varchar(20))"); - -mysqli_query($link, "INSERT INTO friends VALUES (1,'Hartmut'), (2, 'Ulf')"); - -$stmt = mysqli_prepare($link, "SELECT id, name FROM friends"); -mysqli_execute($stmt); - -/* get resultset for metadata */ -$result = mysqli_get_metadata($stmt); - -/* retrieve field information from metadata result set */ -$field = mysqli_fetch_field($result); - -printf("Fieldname: %s\n", $field->name); - -/* close resultset */ -mysqli_free_result($result); - -/* close connection */ -mysqli_close($link); -?> -]]> - </programlisting> - </example> + <function>mysqli_stmt_result_metadata</function> </para> </refsect1> </refentry> http://cvs.php.net/diff.php/phpdoc/en/reference/mysqli/functions/mysqli-param-count.xml?r1=1.6&r2=1.7&ty=u Index: phpdoc/en/reference/mysqli/functions/mysqli-param-count.xml diff -u phpdoc/en/reference/mysqli/functions/mysqli-param-count.xml:1.6 phpdoc/en/reference/mysqli/functions/mysqli-param-count.xml:1.7 --- phpdoc/en/reference/mysqli/functions/mysqli-param-count.xml:1.6 Thu Feb 26 09:48:54 2004 +++ phpdoc/en/reference/mysqli/functions/mysqli-param-count.xml Tue Mar 9 12:21:48 2004 @@ -1,106 +1,28 @@ <?xml version="1.0" encoding="iso-8859-1"?> -<!-- $Revision: 1.6 $ --> +<!-- $Revision: 1.7 $ --> <refentry id="function.mysqli-param-count"> <refnamediv> <refname>mysqli_param_count</refname> - <refname>stmt->param_count</refname> - <refpurpose>Returns the number of parameter for the given statement</refpurpose> + <refpurpose>Alias for <function>mysqli_stmt_param_count</function></refpurpose> </refnamediv> <refsect1> <title>Description</title> - <para>Procedural style:</para> - <methodsynopsis> - <type>int</type><methodname>mysqli_param_count</methodname> - <methodparam><type>object</type><parameter>stmt</parameter></methodparam> - </methodsynopsis> - <para>Object oriented style (property):</para> - <classsynopsis> - <ooclass><classname>stmt</classname></ooclass> - <fieldsynopsis><type>int</type><varname>param_count</varname></fieldsynopsis> - </classsynopsis> - <para> - <function>mysqli_param_count</function> returns the number of parameter - markers present in the prepared statement. - </para> - </refsect1> - <refsect1> - &reftitle.returnvalues; - <para> - returns an integer representing the number of parameters. - </para> - </refsect1> - <refsect1> - &reftitle.seealso; <para> - <function>mysqli_prepare</function> + This function is an alias of <function>mysqli_stmt_param_count</function>. + For a detailled descripton see description of + <function>mysqli_stmt_param_count</function>. </para> + <note> + <para> + <function>mysqli_param_count</function> is deprecated and will be removed. + </para> + </note> </refsect1> <refsect1> - <title>Example</title> - <example> - <title>Object oriented style</title> - <programlisting role="php"> -<![CDATA[ -<?php -$mysqli = new mysqli("localhost", "my_user", "my_password", "world"); - -/* check connection */ -if (mysqli_connect_errno()) { - printf("Connect failed: %s\n", mysqli_connect_error()); - exit(); -} - -if ($stmt = $mysqli->prepare("SELECT Name FROM Country WHERE Name=? OR Code=?")) { - - $marker = $stmt->param_count; - printf("Statement has %d markers.\n", $marker); - - /* close statement */ - $stmt->close(); -} - -/* close connection */ -$mysqli->close(); -?> -]]> - </programlisting> - </example> - <example> - <title>Procedural style</title> - <programlisting role="php"> -<![CDATA[ -<?php -$link = mysqli_connect("localhost", "my_user", "my_password", "world"); - -/* check connection */ -if (mysqli_connect_errno()) { - printf("Connect failed: %s\n", mysqli_connect_error()); - exit(); -} - -if ($stmt = mysqli_prepare($link, "SELECT Name FROM Country WHERE Name=? OR Code=?")) { - - $marker = mysqli_param_count($stmt); - printf("Statement has %d markers.\n", $marker); - - /* close statement */ - mysqli_stmt_close($stmt); -} - -/* close connection */ -mysqli_close($link); -?> -]]> - </programlisting> - </example> + <title>See also</title> <para> - The above examples would produce the following output: + <function>mysqli_stmt_param_count</function> </para> - <screen> -<![CDATA[ -Statement has 2 markers. -]]> - </screen> </refsect1> </refentry> http://cvs.php.net/diff.php/phpdoc/en/reference/mysqli/functions/mysqli-prepare.xml?r1=1.4&r2=1.5&ty=u Index: phpdoc/en/reference/mysqli/functions/mysqli-prepare.xml diff -u phpdoc/en/reference/mysqli/functions/mysqli-prepare.xml:1.4 phpdoc/en/reference/mysqli/functions/mysqli-prepare.xml:1.5 --- phpdoc/en/reference/mysqli/functions/mysqli-prepare.xml:1.4 Thu Feb 26 09:48:54 2004 +++ phpdoc/en/reference/mysqli/functions/mysqli-prepare.xml Tue Mar 9 12:21:48 2004 @@ -1,9 +1,9 @@ <?xml version="1.0" encoding="iso-8859-1"?> -<!-- $Revision: 1.4 $ --> +<!-- $Revision: 1.5 $ --> <refentry id="function.mysqli-prepare"> <refnamediv> <refname>mysqli_prepare</refname> - <refname>stmt->prepare</refname> + <refname>mysqli->prepare</refname> <refpurpose> Prepare a SQL statement for execution </refpurpose> @@ -60,7 +60,7 @@ </note> <para> The parameter markers must be bound to application variables using - <function>mysqli_bind_param</function> and/or <function>mysqli_bind_result</function> + <function>mysqli_stmt_bind_param</function> and/or <function>mysqli_stmt_bind_result</function> before executing the statement or fetching rows. </para> </refsect1> @@ -73,10 +73,10 @@ <refsect1> &reftitle.seealso; <para> - <function>mysqli_execute</function> - <function>mysqli_fetch</function> - <function>mysqli_bind_param</function> - <function>mysqli_bind_result</function> + <function>mysqli_stmt_execute</function>, + <function>mysqli_stmt_fetch</function>, + <function>mysqli_stmt_bind_param</function>, + <function>mysqli_stmt_bind_result</function>, <function>mysqli_stmt_close</function> </para> </refsect1> @@ -143,16 +143,16 @@ if ($stmt = mysqli_prepare($link, "SELECT District FROM City WHERE Name=?")) { /* bind parameters for markers */ - mysqli_bind_param($stmt, "s", $city); + mysqli_stmt_bind_param($stmt, "s", $city); /* execute query */ - mysqli_execute($stmt); + mysqli_stmt_execute($stmt); /* bind result variables */ - mysqli_bind_result($stmt, $district); + mysqli_stmt_bind_result($stmt, $district); /* fetch value */ - mysqli_fetch($stmt); + mysqli_stmt_fetch($stmt); printf("%s is in district %s\n", $city, $district); http://cvs.php.net/diff.php/phpdoc/en/reference/mysqli/functions/mysqli-send-long-data.xml?r1=1.3&r2=1.4&ty=u Index: phpdoc/en/reference/mysqli/functions/mysqli-send-long-data.xml diff -u phpdoc/en/reference/mysqli/functions/mysqli-send-long-data.xml:1.3 phpdoc/en/reference/mysqli/functions/mysqli-send-long-data.xml:1.4 --- phpdoc/en/reference/mysqli/functions/mysqli-send-long-data.xml:1.3 Wed Jan 28 18:18:42 2004 +++ phpdoc/en/reference/mysqli/functions/mysqli-send-long-data.xml Tue Mar 9 12:21:48 2004 @@ -1,49 +1,27 @@ <?xml version="1.0" encoding="iso-8859-1"?> -<!-- $Revision: 1.3 $ --> +<!-- $Revision: 1.4 $ --> <refentry id="function.mysqli-send-long-data"> <refnamediv> - <refname>mysqli_send_long_data</refname> - <refname>stmt->send_long_data</refname> - <refpurpose>Send data in blocks</refpurpose> + <refname>mysqli_send_long_datat</refname> + <refpurpose>Alias for <function>mysqli_stmt_send_long_data</function></refpurpose> </refnamediv> <refsect1> <title>Description</title> - <para>Procedural style:</para> - <methodsynopsis> - <type>bool</type><methodname>mysqli_send_long_data</methodname> - <methodparam><type>object</type><parameter>stmt</parameter></methodparam> - <methodparam><type>int</type><parameter>param_nr</parameter></methodparam> - <methodparam><type>string</type><parameter>data</parameter></methodparam> - </methodsynopsis> - <para>Object oriented style (method)</para> - <classsynopsis> - <ooclass><classname>stmt</classname></ooclass> - <methodsynopsis> - <type>bool</type><methodname>send_long_data</methodname> - <methodparam><type>int</type><parameter>param_nr</parameter></methodparam> - <methodparam><type>string</type><parameter>data</parameter></methodparam> - </methodsynopsis> - </classsynopsis> - <para> - Allows to send parameter data to the server in pieces (or chunks), e.g. if the - size of a blob exceeds the size of <literal>max_allowed_packet</literal>. - This function can be called multiple times to send the parts of a character or - binary data value for a column, which must be one of the TEXT or BLOB datatypes. - </para> + <para> + This function is an alias of <function>mysqli_stmt_send_long_data</function>. + For a detailled descripton see description of + <function>mysqli_stmt_send_long_data</function>. + </para> + <note> <para> - <parameter>param_nr</parameter> indicates which parameter to associate the data with. - Parameters are numbered beginning with 0. data is a string containing data to be sent. + <function>mysqli_send_long_data</function> is deprecated and will be removed. </para> - </refsect1> - <refsect1> - <title>Return values</title> - <para>&return.success;</para> + </note> </refsect1> <refsect1> <title>See also</title> <para> - <function>mysqli_prepare</function>, - <function>mysqli_bind_param</function> + <function>mysqli_stmt_send_long_data</function> </para> </refsect1> </refentry> http://cvs.php.net/diff.php/phpdoc/en/reference/mysqli/functions/mysqli-stmt-affected-rows.xml?r1=1.4&r2=1.5&ty=u Index: phpdoc/en/reference/mysqli/functions/mysqli-stmt-affected-rows.xml diff -u phpdoc/en/reference/mysqli/functions/mysqli-stmt-affected-rows.xml:1.4 phpdoc/en/reference/mysqli/functions/mysqli-stmt-affected-rows.xml:1.5 --- phpdoc/en/reference/mysqli/functions/mysqli-stmt-affected-rows.xml:1.4 Fri Feb 27 04:22:17 2004 +++ phpdoc/en/reference/mysqli/functions/mysqli-stmt-affected-rows.xml Tue Mar 9 12:21:48 2004 @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="iso-8859-1"?> -<!-- $Revision: 1.4 $ --> +<!-- $Revision: 1.5 $ --> <refentry id="function.mysqli-stmt-affected-rows"> <refnamediv> <refname>mysqli_stmt_affected_rows</refname> @@ -117,10 +117,10 @@ /* Bind variable for placeholder */ $code = 'A%'; - mysqli_bind_param($stmt, "s", $code); + mysqli_stmt_bind_param($stmt, "s", $code); /* execute statement */ - mysqli_execute($stmt); + mysqli_stmt_execute($stmt); printf("rows inserted: %d\n", mysqli_stmt_affected_rows($stmt)); http://cvs.php.net/diff.php/phpdoc/en/reference/mysqli/functions/mysqli-stmt-close.xml?r1=1.3&r2=1.4&ty=u Index: phpdoc/en/reference/mysqli/functions/mysqli-stmt-close.xml diff -u phpdoc/en/reference/mysqli/functions/mysqli-stmt-close.xml:1.3 phpdoc/en/reference/mysqli/functions/mysqli-stmt-close.xml:1.4 --- phpdoc/en/reference/mysqli/functions/mysqli-stmt-close.xml:1.3 Wed Jan 28 18:18:42 2004 +++ phpdoc/en/reference/mysqli/functions/mysqli-stmt-close.xml Tue Mar 9 12:21:48 2004 @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="iso-8859-1"?> -<!-- $Revision: 1.3 $ --> +<!-- $Revision: 1.4 $ --> <refentry id="function.mysqli-stmt-close"> <refnamediv> <refname>mysqli_stmt_close</refname> @@ -35,9 +35,7 @@ <refsect1> <title>See also</title> <para> - <function>mysqli_stmt_num_rows</function>, <function>mysqli_prepare</function>, - <function>mysqli_execute</function> </para> </refsect1> </refentry> http://cvs.php.net/diff.php/phpdoc/en/reference/mysqli/functions/mysqli-stmt-data-seek.xml?r1=1.3&r2=1.4&ty=u Index: phpdoc/en/reference/mysqli/functions/mysqli-stmt-data-seek.xml diff -u phpdoc/en/reference/mysqli/functions/mysqli-stmt-data-seek.xml:1.3 phpdoc/en/reference/mysqli/functions/mysqli-stmt-data-seek.xml:1.4 --- phpdoc/en/reference/mysqli/functions/mysqli-stmt-data-seek.xml:1.3 Fri Feb 27 04:22:17 2004 +++ phpdoc/en/reference/mysqli/functions/mysqli-stmt-data-seek.xml Tue Mar 9 12:21:48 2004 @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="iso-8859-1"?> -<!-- $Revision: 1.3 $ --> +<!-- $Revision: 1.4 $ --> <refentry id="function.mysqli-stmt-data-seek"> <refnamediv> <refname>mysqli_stmt_data_seek</refname> @@ -106,10 +106,10 @@ if ($stmt = mysqli_prepare($link, $query)) { /* execute query */ - mysqli_execute($stmt); + mysqli_stmt_execute($stmt); /* bind result variables */ - mysqli_bind_result($stmt, $name, $code); + mysqli_stmt_bind_result($stmt, $name, $code); /* store result */ mysqli_stmt_store_result($stmt); @@ -118,7 +118,7 @@ mysqli_stmt_data_seek($stmt, 399); /* fetch values */ - mysqli_fetch($stmt); + mysqli_stmt_fetch($stmt); printf ("City: %s Countrycode: %s\n", $name, $code); http://cvs.php.net/diff.php/phpdoc/en/reference/mysqli/functions/mysqli-stmt-errno.xml?r1=1.4&r2=1.5&ty=u Index: phpdoc/en/reference/mysqli/functions/mysqli-stmt-errno.xml diff -u phpdoc/en/reference/mysqli/functions/mysqli-stmt-errno.xml:1.4 phpdoc/en/reference/mysqli/functions/mysqli-stmt-errno.xml:1.5 --- phpdoc/en/reference/mysqli/functions/mysqli-stmt-errno.xml:1.4 Fri Feb 27 04:22:17 2004 +++ phpdoc/en/reference/mysqli/functions/mysqli-stmt-errno.xml Tue Mar 9 12:21:48 2004 @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="iso-8859-1"?> -<!-- $Revision: 1.4 $ --> +<!-- $Revision: 1.5 $ --> <refentry id="function.mysqli-stmt-errno"> <refnamediv> <refname>mysqli_stmt_errno</refname> @@ -110,7 +110,7 @@ mysqli_query($link, "DROP TABLE myCountry"); /* execute query */ - mysqli_execute($stmt); + mysqli_stmt_execute($stmt); printf("Error: %d.\n", mysqli_stmt_errno($stmt)); http://cvs.php.net/diff.php/phpdoc/en/reference/mysqli/functions/mysqli-stmt-error.xml?r1=1.4&r2=1.5&ty=u Index: phpdoc/en/reference/mysqli/functions/mysqli-stmt-error.xml diff -u phpdoc/en/reference/mysqli/functions/mysqli-stmt-error.xml:1.4 phpdoc/en/reference/mysqli/functions/mysqli-stmt-error.xml:1.5 --- phpdoc/en/reference/mysqli/functions/mysqli-stmt-error.xml:1.4 Fri Feb 27 04:22:17 2004 +++ phpdoc/en/reference/mysqli/functions/mysqli-stmt-error.xml Tue Mar 9 12:21:48 2004 @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="iso-8859-1"?> -<!-- $Revision: 1.4 $ --> +<!-- $Revision: 1.5 $ --> <refentry id="function.mysqli-stmt-error"> <refnamediv> <refname>mysqli_stmt_error</refname> @@ -103,7 +103,7 @@ mysqli_query($link, "DROP TABLE myCountry"); /* execute query */ - mysqli_execute($stmt); + mysqli_stmt_execute($stmt); printf("Error: %s.\n", mysqli_stmt_error($stmt)); http://cvs.php.net/diff.php/phpdoc/en/reference/mysqli/functions/mysqli-stmt-num-rows.xml?r1=1.2&r2=1.3&ty=u Index: phpdoc/en/reference/mysqli/functions/mysqli-stmt-num-rows.xml diff -u phpdoc/en/reference/mysqli/functions/mysqli-stmt-num-rows.xml:1.2 phpdoc/en/reference/mysqli/functions/mysqli-stmt-num-rows.xml:1.3 --- phpdoc/en/reference/mysqli/functions/mysqli-stmt-num-rows.xml:1.2 Fri Feb 27 04:22:17 2004 +++ phpdoc/en/reference/mysqli/functions/mysqli-stmt-num-rows.xml Tue Mar 9 12:21:48 2004 @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="iso-8859-1"?> -<!-- $Revision: 1.2 $ --> +<!-- $Revision: 1.3 $ --> <refentry id="function.mysqli-stmt-num-rows"> <refnamediv> <refname>mysqli_stmt_num_rows</refname> @@ -97,7 +97,7 @@ if ($stmt = mysqli_prepare($link, $query)) { /* execute query */ - mysqli_execute($stmt); + mysqli_stmt_execute($stmt); /* store result */ mysqli_stmt_store_result($stmt); http://cvs.php.net/diff.php/phpdoc/en/reference/mysqli/functions/mysqli-stmt-sqlstate.xml?r1=1.2&r2=1.3&ty=u Index: phpdoc/en/reference/mysqli/functions/mysqli-stmt-sqlstate.xml diff -u phpdoc/en/reference/mysqli/functions/mysqli-stmt-sqlstate.xml:1.2 phpdoc/en/reference/mysqli/functions/mysqli-stmt-sqlstate.xml:1.3 --- phpdoc/en/reference/mysqli/functions/mysqli-stmt-sqlstate.xml:1.2 Fri Feb 27 04:22:17 2004 +++ phpdoc/en/reference/mysqli/functions/mysqli-stmt-sqlstate.xml Tue Mar 9 12:21:48 2004 @@ -1,9 +1,9 @@ <?xml version="1.0" encoding="iso-8859-1"?> -<!-- $Revision: 1.2 $ --> +<!-- $Revision: 1.3 $ --> <refentry id="function.mysqli-stmt-sqlstate"> <refnamediv> <refname>mysqli_stmt_sqlstate</refname> - <refpurpose></refpurpose> + <refpurpose>returns SQLSTATE error from previous statement operation</refpurpose> </refnamediv> <refsect1> <title>Description</title> @@ -105,7 +105,7 @@ mysqli_query($link, "DROP TABLE myCountry"); /* execute query */ - mysqli_execute($stmt); + mysqli_stmt_execute($stmt); printf("Error: %s.\n", mysqli_stmt_sqlstate($stmt)); http://cvs.php.net/diff.php/phpdoc/en/reference/mysqli/functions/mysqli-stmt-store-result.xml?r1=1.3&r2=1.4&ty=u Index: phpdoc/en/reference/mysqli/functions/mysqli-stmt-store-result.xml diff -u phpdoc/en/reference/mysqli/functions/mysqli-stmt-store-result.xml:1.3 phpdoc/en/reference/mysqli/functions/mysqli-stmt-store-result.xml:1.4 --- phpdoc/en/reference/mysqli/functions/mysqli-stmt-store-result.xml:1.3 Fri Feb 27 04:22:17 2004 +++ phpdoc/en/reference/mysqli/functions/mysqli-stmt-store-result.xml Tue Mar 9 12:21:48 2004 @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="iso-8859-1"?> -<!-- $Revision: 1.3 $ --> +<!-- $Revision: 1.4 $ --> <refentry id="function.mysqli-stmt-store-result"> <refnamediv> <refname>mysqli_stmt_store_result</refname> @@ -32,7 +32,7 @@ It is unnecessary to call <function>mysql_stmt_store_result</function> for other queries, but if you do, it will not harm or cause any notable performance in all cases. You can detect whether the query produced a result set by checking if - <function>mysql_get_metadata</function> returns NULL. + <function>mysql_stmt_result_metadata</function> returns NULL. </para> </note> </refsect1> @@ -44,7 +44,7 @@ <title>See also</title> <para> <function>mysqli_prepare</function>, - <function>mysqli_get_metadata</function>, + <function>mysqli_stmt_result_metadata</function>, <function>mysqli_fetch</function> </para> </refsect1> @@ -103,7 +103,7 @@ if ($stmt = mysqli_prepare($link, $query)) { /* execute query */ - mysqli_execute($stmt); + mysqli_stmt_execute($stmt); /* store result */ mysqli_stmt_store_result($stmt); http://cvs.php.net/co.php/phpdoc/en/reference/mysqli/functions/mysqli-stmt-bind-param.xml?r=1.1&p=1 Index: phpdoc/en/reference/mysqli/functions/mysqli-stmt-bind-param.xml +++ phpdoc/en/reference/mysqli/functions/mysqli-stmt-bind-param.xml <?xml version="1.0" encoding="iso-8859-1"?> <!-- $Revision: 1.1 $ --> <refentry id="function.mysqli-stmt-bind-param"> <refnamediv> <refname>mysqli_stmt_bind_param</refname> <refname>stmt->bind_param</refname> <refpurpose>Binds variables to a prepared statement as parameters</refpurpose> </refnamediv> <refsect1> <title>Description</title> <para>Procedural style:</para> <methodsynopsis> <type>bool</type><methodname>mysqli_stmt_bind_param</methodname> <methodparam><type>object</type><parameter>stmt</parameter></methodparam> <methodparam><type>string</type><parameter>types</parameter></methodparam> <methodparam><type>mixed</type><parameter>var1</parameter></methodparam> <methodparam choice="opt"><type>mixed</type><parameter>var2, ...</parameter></methodparam> </methodsynopsis> <para>Object oriented style (method):</para> <classsynopsis> <ooclass><classname>stmt</classname></ooclass> <methodsynopsis> <type>bool</type> <methodname>bind_param</methodname> <methodparam><type>array</type><parameter>types</parameter></methodparam> <methodparam><type>mixed</type><parameter>var1</parameter></methodparam> <methodparam choice="opt"><type>mixed</type><parameter>var2, ...</parameter></methodparam> </methodsynopsis> </classsynopsis> <para> <function>mysql_bind_param</function> is used to bind variables for the parameter markers in the SQL statement that was passed to <function>mysql_prepare</function>. The string <parameter>types</parameter> contains one or more characters which specify the types for the corresponding bind variables <table> <title>Type specification chars</title> <tgroup cols='2'> <thead> <row> <entry>Character</entry> <entry>Description</entry> </row> </thead> <tbody> <row> <entry>i</entry> <entry>corresponding variable has type integer</entry> </row> <row> <entry>d</entry> <entry>corresponding variable has type double</entry> </row> <row> <entry>s</entry> <entry>corresponding variable has type string</entry> </row> <row> <entry>b</entry> <entry>corresponding variable is a blob and will be send in packages</entry> </row> </tbody> </tgroup> </table> </para> <note> <para> If data size of a variable exceeds max. allowed package size (max_allowed_package), you have to specify <literal>b</literal> in <parameter>types</parameter> and use <function>mysqli_stmt_send_long_data</function> to send the data in packages. </para> <para> The number of variables and length of string <parameter>types</parameter> must match the parameters in the statement. </para> </note> </refsect1> <refsect1> <title>Return values</title> <para> &return.success; </para> </refsect1> <refsect1> <title>See also</title> <para> <function>mysqli_stmt_bind_result</function>, <function>mysqi_stmt_execute</function>, <function>mysqi_stmt_fetch</function>, <function>mysqli_prepare</function>, <function>mysqli_stmt_send_long_data</function>, <function>mysqli_stmt_errno</function>, <function>mysqli_stmt_error</function> </para> </refsect1> <refsect1> <title>Example</title> <example> <title>Object oriented style</title> <programlisting role="php"> <![CDATA[ <?php $mysqli = new mysqli('localhost', 'my_user', 'my_password', 'world'); /* check connection */ if (mysqli_connect_errno()) { printf("Connect failed: %s\n", mysqli_connect_error()); exit(); } $stmt = $mysqli->prepare("INSERT INTO CountryLanguage VALUES (?, ?, ?, ?)"); $stmt->bind_param('sssd', $code, $language, $official, $percent); $code = 'DEU'; $language = 'Bavarian'; $official = "F"; $percent = 11.2; /* execute prepared statement */ $stmt->execute(); printf("%d Row inserted.\n", $stmt->affected_rows); /* close statement and connection */ $stmt->close(); /* Clean up table CountryLanguage */ $mysqli->query("DELETE FROM CountryLanguage WHERE Language='Bavarian'"); printf("%d Row deleted.\n", $mysqli->affected_rows); /* close connection */ $mysqli->close(); ?> ]]> </programlisting> </example> <example> <title>Procedural style</title> <programlisting role="php"> <![CDATA[ <?php $link = mysqli_connect('localhost', 'my_user', 'my_password', 'world'); /* check connection */ if (!$link) { printf("Connect failed: %s\n", mysqli_connect_error()); exit(); } $stmt = mysqli_prepare($link, "INSERT INTO CountryLanguage VALUES (?, ?, ?, ?)"); mysqli_stmt_bind_param($stmt, 'sssd', $code, $language, $official, $percent); $code = 'DEU'; $language = 'Bavarian'; $official = "F"; $percent = 11.2; /* execute prepared statement */ mysqi_stmt_execute($stmt); printf("%d Row inserted.\n", mysqli_stmt_affected_rows($stmt)); /* close statement and connection */ mysqli_stmt_close($stmt); /* Clean up table CountryLanguage */ mysqli_query($link, "DELETE FROM CountryLanguage WHERE Language='Bavarian'"); printf("%d Row deleted.\n", mysqli_affected_rows($link)); /* close connection */ mysqli_close($link); ?> ]]> </programlisting> </example> <para> The above examples would produce the following output: </para> <screen> <![CDATA[ 1 Row inserted. 1 Row deleted. ]]> </screen> </refsect1> </refentry> <!-- Keep this comment at the end of the file Local variables: mode: sgml sgml-omittag:t sgml-shorttag:t sgml-minimize-attributes:nil sgml-always-quote-attributes:t sgml-indent-step:1 sgml-indent-data:t indent-tabs-mode:nil sgml-parent-document:nil sgml-default-dtd-file:"../../../../manual.ced" sgml-exposed-tags:nil sgml-local-catalogs:nil sgml-local-ecat-files:nil End: vim600: syn=xml fen fdm=syntax fdl=2 si vim: et tw=78 syn=sgml vi: ts=1 sw=1 --> http://cvs.php.net/co.php/phpdoc/en/reference/mysqli/functions/mysqli-stmt-bind-result.xml?r=1.1&p=1 Index: phpdoc/en/reference/mysqli/functions/mysqli-stmt-bind-result.xml +++ phpdoc/en/reference/mysqli/functions/mysqli-stmt-bind-result.xml <?xml version="1.0" encoding="iso-8859-1"?> <!-- $Revision: 1.1 $ --> <refentry id="function.mysqli-stmt-bind-result"> <refnamediv> <refname>mysqli_stmt_bind_result</refname> <refname>stmt->bind_result</refname> <refpurpose>Binds variables to a prepared statement for result storage</refpurpose> </refnamediv> <refsect1> <title>Description</title> <para>Procedural style:</para> <methodsynopsis> <type>bool</type><methodname>mysqli_stnt_bind_result</methodname> <methodparam><type>object</type><parameter>stmt</parameter></methodparam> <methodparam><type>mixed</type><parameter>var1</parameter></methodparam> <methodparam choice="opt"><type>mixed</type><parameter>var2, ...</parameter></methodparam> </methodsynopsis> <para>Object oriented style (method):</para> <classsynopsis> <ooclass><classname>stmt</classname></ooclass> <methodsynopsis> <type>bool</type> <methodname>bind_result</methodname> <methodparam><type>mixed</type><parameter>var1</parameter></methodparam> <methodparam choice="opt"><type>mixed</type><parameter>var2, ...</parameter></methodparam> </methodsynopsis> </classsynopsis> <para> <function>mysqli_stmt_bind_result</function> is used to associate (bind) columns in the result set to variables. When <function>mysqli_stmt_fetch</function> is called to fetch data, the MySQL client/server protocol places the data for the bound columns into the specified variables <parameter>var1, ...</parameter>. </para> <note> <para> Note that all columns must be bound prior to calling <function>mysqli_stmt_fetch</function>. Depending on column types bound variables can silently change to the corresponding PHP type. </para> <para> A column can be bound or rebound at any time, even after a result set has been partially retrieved. The new binding takes effect the next time <function>mysqli_stmt_fetch</function> is called. </para> </note> </refsect1> <refsect1> <title>Return values</title> <para> &return.success; </para> </refsect1> <refsect1> <title>See also</title> <para> <function>mysqli_stmt_bind_param</function>, <function>mysqli_stmt_execute</function>, <function>mysqli_stmt_fetch</function>, <function>mysqli_prepare</function>, <function>mysqli_stmt_prepare</function>, <function>mysqli_stmt_init</function>, <function>mysqli_stmt_errno</function>, <function>mysqli_stmt_error</function> </para> </refsect1> <refsect1> <title>Example</title> <example> <title>Object oriented style</title> <programlisting role="php"> <![CDATA[ <?php $mysqli = new mysqli("localhost", "my_user", "my_password", "world"); if (mysqli_connect_errno()) { printf("Connect failed: %s\n", mysqli_connect_error()); exit(); } /* prepare statement */ if ($stmt = $mysqli->prepare("SELECT Code, Name FROM Country ORDER BY Name LIMIT 5")) { $stmt->execute(); /* bind variables to prepared statement */ $stmt->bind_result($col1, $col2); /* fetch values */ while ($stmt->fetch()) { printf("%s %s\n", $col1, $col2); } /* close statement */ $stmt->close(); } /* close connection */ $mysqli->close(); ?> ]]> </programlisting> </example> <example> <title>Procedural style</title> <programlisting role="php"> <![CDATA[ <?php $link = mysqli_connect("localhost", "my_user", "my_password", "world"); /* check connection */ if (!$link) { printf("Connect failed: %s\n", mysqli_connect_error()); exit(); } /* prepare statement */ if ($stmt = mysqli_prepare($link, "SELECT Code, Name FROM Country ORDER BY Name LIMIT 5")) { mysqli_stmt_execute($stmt); /* bind variables to prepared statement */ mysqli_stmt_bind_result($stmt, $col1, $col2); /* fetch values */ while (mysqli_stmt_fetch($stmt)) { printf("%s %s\n", $col1, $col2); } /* close statement */ mysqli_stmt_close($stmt); } /* close connection */ mysqli_close($link); ?> ]]> </programlisting> </example> <para> The above examples would produce the following output: </para> <screen> <![CDATA[ AFG Afghanistan ALB Albania DZA Algeria ASM American Samoa AND Andorra ]]> </screen> </refsect1> </refentry> <!-- Keep this comment at the end of the file Local variables: mode: sgml sgml-omittag:t sgml-shorttag:t sgml-minimize-attributes:nil sgml-always-quote-attributes:t sgml-indent-step:1 sgml-indent-data:t indent-tabs-mode:nil sgml-parent-document:nil sgml-default-dtd-file:"../../../../manual.ced" sgml-exposed-tags:nil sgml-local-catalogs:nil sgml-local-ecat-files:nil End: vim600: syn=xml fen fdm=syntax fdl=2 si vim: et tw=78 syn=sgml vi: ts=1 sw=1 --> http://cvs.php.net/co.php/phpdoc/en/reference/mysqli/functions/mysqli-stmt-execute.xml?r=1.1&p=1 Index: phpdoc/en/reference/mysqli/functions/mysqli-stmt-execute.xml +++ phpdoc/en/reference/mysqli/functions/mysqli-stmt-execute.xml <?xml version="1.0" encoding="iso-8859-1"?> <!-- $Revision: 1.1 $ --> <refentry id="function.mysqli-stmt-execute"> <refnamediv> <refname>mysqli_stmt_execute</refname> <refname>stmt->execute</refname> <refpurpose>Executes a prepared Query</refpurpose> </refnamediv> <refsect1> <title>Description</title> <para>Procedural style:</para> <methodsynopsis> <type>bool</type><methodname>mysqli_stmt_execute</methodname> <methodparam><type>object</type><parameter>stmt</parameter></methodparam> </methodsynopsis> <para>Object oriented style (method):</para> <classsynopsis> <ooclass><classname>mysql</classname></ooclass> <methodsynopsis> <type>bool</type> <methodname>execute</methodname> <methodparam><type>void</type><parameter></parameter></methodparam> </methodsynopsis> </classsynopsis> <para> The <function>mysqli_stmt_execute</function> function executes a query that has been previously prepared using the <function>mysqli_prepare</function> function represented by the <parameter>stmt</parameter> object. 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_stmt_execute</function>, the <function>mysqli_fetch</function> function must be used to fetch the data prior to preforming any additional queries. </para> </note> </refsect1> <refsect1> <title>Return values</title> <para>&return.success;</para> </refsect1> <refsect1> <title>See also</title> <para> <function>mysqli_prepare</function> <function>mysqli_stmt_bind_param</function>. </para> </refsect1> <refsect1> <title>Example</title> <example> <title>Object oriented style</title> <programlisting role="php"> <![CDATA[ <?php $mysqli = new mysqli("localhost", "my_user", "my_password", "world"); /* check connection */ if (mysqli_connect_errno()) { printf("Connect failed: %s\n", mysqli_connect_error()); exit(); } $mysqli->query("CREATE TABLE myCity LIKE City"); /* Prepare an insert statement */ $query = "INSERT INTO myCity (Name, CountryCode, District) VALUES (?,?,?)"; $stmt = $mysqli->prepare($query); $stmt->bind_param("sss", $val1, $val2, $val3); $val1 = 'Stuttgart'; $val2 = 'DEU'; $val3 = 'Baden-Wuerttemberg'; /* Execute the statement */ $stmt->execute(); $val1 = 'Bordeaux'; $val2 = 'FRA'; $val3 = 'Aquitaine'; /* Execute the statement */ $stmt->execute(); /* close statement */ $stmt->close(); /* retrieve all rows from myCity */ $query = "SELECT Name, CountryCode, District FROM myCity"; if ($result = $mysqli->query($query)) { while ($row = $result->fetch_row()) { printf("%s (%s,%s)\n", $row[0], $row[1], $row[2]); } /* free result set */ $result->close(); } /* remove table */ $mysqli->query("DROP TABLE myCity"); /* close connection */ $mysqli->close(); ?> ]]> </programlisting> </example> <example> <title>Procedural style</title> <programlisting role="php"> <![CDATA[ <?php $link = mysqli_connect("localhost", "my_user", "my_password", "world"); /* check connection */ if (mysqli_connect_errno()) { printf("Connect failed: %s\n", mysqli_connect_error()); exit(); } mysqli_query($link, "CREATE TABLE myCity LIKE City"); /* Prepare an insert statement */ $query = "INSERT INTO myCity (Name, CountryCode, District) VALUES (?,?,?)"; $stmt = mysqli_prepare($link, $query); mysqli_stmt_bind_param($stmt, "sss", $val1, $val2, $val3); $val1 = 'Stuttgart'; $val2 = 'DEU'; $val3 = 'Baden-Wuerttemberg'; /* Execute the statement */ mysqli_stmt_execute($stmt); $val1 = 'Bordeaux'; $val2 = 'FRA'; $val3 = 'Aquitaine'; /* Execute the statement */ mysqli_stmt_execute($stmt); /* close statement */ mysqli_stmt_close($stmt); /* retrieve all rows from myCity */ $query = "SELECT Name, CountryCode, District FROM myCity"; if ($result = mysqli_query($link, $query)) { while ($row = mysqli_fetch_row($result)) { printf("%s (%s,%s)\n", $row[0], $row[1], $row[2]); } /* free result set */ mysqli_free_result($result); } /* remove table */ mysqli_query($link, "DROP TABLE myCity"); /* close connection */ mysqli_close($link); ?> ]]> </programlisting> </example> <para> The above examples would produce the following output: </para> <screen> <![CDATA[ Stuttgart (DEU,Baden-Wuerttemberg) Bordeaux (FRA,Aquitaine) ]]> </screen> </refsect1> </refentry> <!-- Keep this comment at the end of the file Local variables: mode: sgml sgml-omittag:t sgml-shorttag:t sgml-minimize-attributes:nil sgml-always-quote-attributes:t sgml-indent-step:1 sgml-indent-data:t indent-tabs-mode:nil sgml-parent-document:nil sgml-default-dtd-file:"../../../../manual.ced" sgml-exposed-tags:nil sgml-local-catalogs:nil sgml-local-ecat-files:nil End: vim600: syn=xml fen fdm=syntax fdl=2 si vim: et tw=78 syn=sgml vi: ts=1 sw=1 --> http://cvs.php.net/co.php/phpdoc/en/reference/mysqli/functions/mysqli-stmt-fetch.xml?r=1.1&p=1 Index: phpdoc/en/reference/mysqli/functions/mysqli-stmt-fetch.xml +++ phpdoc/en/reference/mysqli/functions/mysqli-stmt-fetch.xml <?xml version="1.0" encoding="iso-8859-1"?> <!-- $Revision: 1.1 $ --> <refentry id="function.mysqli-stmt-fetch"> <refnamediv> <refname>mysqli_stmt_fetch</refname> <refname>stmt->fetch</refname> <refpurpose> Fetch results from a prepared statement into the bound variables </refpurpose> </refnamediv> <refsect1> <title>Description</title> <para>Procedural style:</para> <methodsynopsis> <type>mixed</type><methodname>mysqli_stmt_fetch</methodname> <methodparam><type>object</type><parameter>stmt</parameter></methodparam> </methodsynopsis> <para>Object oriented style (method):</para> <classsynopsis> <ooclass><classname>stmt</classname></ooclass> <methodsynopsis> <type>mixed</type> <methodname>fetch</methodname> <methodparam><type>void</type><parameter></parameter></methodparam> </methodsynopsis> </classsynopsis> <para> <function>mysqli_stmt_fetch</function> returns row data using the variables bound by <function>mysqli_stmt_bind_result</function>. </para> <note> <para> Note that all columns must be bound by the application before calling <function>mysqli_stmt_fetch</function>. </para> </note> </refsect1> <refsect1> <title>Return values</title> <table> <title>Return values</title> <tgroup cols='2'> <thead> <row> <entry>Value</entry> <entry>Description</entry> </row> </thead> <tbody> <row> <entry>&true;</entry> <entry>Success. Data has been fetched</entry> </row> <row> <entry>&false;</entry> <entry>Error occured</entry> </row> <row> <entry><literal>&null;</literal></entry> <entry>No more rows/data exists</entry> </row> </tbody> </tgroup> </table> </refsect1> <refsect1> <title>See also</title> <para> <function>mysqli_prepare</function>, <function>mysqli_stmt_errno</function>, <function>mysqli_stmt_error</function>, <function>mysqli_stmt_bind_result</function> </para> </refsect1> <refsect1> <title>Example</title> <example> <title>Object oriented style</title> <programlisting role="php"> <![CDATA[ <?php $mysqli = new mysqli("localhost", "my_user", "my_password", "world"); /* check connection */ if (mysqli_connect_errno()) { printf("Connect failed: %s\n", mysqli_connect_error()); exit(); } $query = "SELECT Name, CountryCode FROM City ORDER by ID DESC LIMIT 150,5"; if ($stmt = $mysqli->prepare($query)) { /* execute statement */ $stmt->execute(); /* bind result variables */ $stmt->bind_result($name, $code); /* fetch values */ while ($stmt->fetch()) { printf ("%s (%s)\n", $name, $code); } /* close statement */ $stmt->close(); } /* close connection */ $mysqli->close(); ?> ]]> </programlisting> </example> <example> <title>Procedural style</title> <programlisting role="php"> <![CDATA[ <?php $link = mysqli_connect("localhost", "my_user", "my_password", "world"); /* check connection */ if (mysqli_connect_errno()) { printf("Connect failed: %s\n", mysqli_connect_error()); exit(); } $query = "SELECT Name, CountryCode FROM City ORDER by ID DESC LIMIT 150,5"; if ($stmt = mysqli_prepare($link, $query)) { /* execute statement */ mysqli_stmt_execute($stmt); /* bind result variables */ mysqli_stmt_bind_result($stmt, $name, $code); /* fetch values */ while (mysqli_stmt_fetch($stmt)) { printf ("%s (%s)\n", $name, $code); } /* close statement */ mysqli_stmt_close($stmt); } /* close connection */ mysqli_close($link); ?> ]]> </programlisting> </example> <para> The above examples would produce the following output: </para> <screen> <![CDATA[ Rockford (USA) Tallahassee (USA) Salinas (USA) Santa Clarita (USA) Springfield (USA) ]]> </screen> </refsect1> </refentry> <!-- Keep this comment at the end of the file Local variables: mode: sgml sgml-omittag:t sgml-shorttag:t sgml-minimize-attributes:nil sgml-always-quote-attributes:t sgml-indent-step:1 sgml-indent-data:t indent-tabs-mode:nil sgml-parent-document:nil sgml-default-dtd-file:"../../../../manual.ced" sgml-exposed-tags:nil sgml-local-catalogs:nil sgml-local-ecat-files:nil End: vim600: syn=xml fen fdm=syntax fdl=2 si vim: et tw=78 syn=sgml vi: ts=1 sw=1 --> http://cvs.php.net/co.php/phpdoc/en/reference/mysqli/functions/mysqli-stmt-init.xml?r=1.1&p=1 Index: phpdoc/en/reference/mysqli/functions/mysqli-stmt-init.xml +++ phpdoc/en/reference/mysqli/functions/mysqli-stmt-init.xml <?xml version="1.0" encoding="iso-8859-1"?> <!-- $Revision: 1.1 $ --> <refentry id="function.mysqli-stmt-init"> <refnamediv> <refname>mysqli_stmt-init</refname> <refpurpose> Initializes a statement and returns an object for use with mysqli_stmt_prepare </refpurpose> </refnamediv> <refsect1> <title>Description</title> <methodsynopsis> <type>object</type><methodname>mysqli_stmt_init</methodname> <void/> </methodsynopsis> <para> Allocates and initializes a statement object suitable for <function>mysqli_stmt_prepare</function>. </para> <note> <para> Any subsequent calls to any mysqli_stmt function will fail until <function>mysqli_stmt_prepare</function> was called. </para> </note> </refsect1> <refsect1> &reftitle.returnvalues; <para> Returns an object. </para> </refsect1> <refsect1> &reftitle.seealso; <para> <function>mysqli_stmt_prepare</function> </para> </refsect1> </refentry> <!-- Keep this comment at the end of the file Local variables: mode: sgml sgml-omittag:t sgml-shorttag:t sgml-minimize-attributes:nil sgml-always-quote-attributes:t sgml-indent-step:1 sgml-indent-data:t indent-tabs-mode:nil sgml-parent-document:nil sgml-default-dtd-file:"../../../../manual.ced" sgml-exposed-tags:nil sgml-local-catalogs:nil sgml-local-ecat-files:nil End: vim600: syn=xml fen fdm=syntax fdl=2 si vim: et tw=78 syn=sgml vi: ts=1 sw=1 --> http://cvs.php.net/co.php/phpdoc/en/reference/mysqli/functions/mysqli-stmt-param-count.xml?r=1.1&p=1 Index: phpdoc/en/reference/mysqli/functions/mysqli-stmt-param-count.xml +++ phpdoc/en/reference/mysqli/functions/mysqli-stmt-param-count.xml <?xml version="1.0" encoding="iso-8859-1"?> <!-- $Revision: 1.1 $ --> <refentry id="function.mysqli-stmt-param-count"> <refnamediv> <refname>mysqli_stmt_param_count</refname> <refname>stmt->param_count</refname> <refpurpose>Returns the number of parameter for the given statement</refpurpose> </refnamediv> <refsect1> <title>Description</title> <para>Procedural style:</para> <methodsynopsis> <type>int</type><methodname>mysqli_stmt_param_count</methodname> <methodparam><type>object</type><parameter>stmt</parameter></methodparam> </methodsynopsis> <para>Object oriented style (property):</para> <classsynopsis> <ooclass><classname>stmt</classname></ooclass> <fieldsynopsis><type>int</type><varname>param_count</varname></fieldsynopsis> </classsynopsis> <para> <function>mysqli_stmt_param_count</function> returns the number of parameter markers present in the prepared statement. </para> </refsect1> <refsect1> &reftitle.returnvalues; <para> returns an integer representing the number of parameters. </para> </refsect1> <refsect1> &reftitle.seealso; <para> <function>mysqli_prepare</function> </para> </refsect1> <refsect1> <title>Example</title> <example> <title>Object oriented style</title> <programlisting role="php"> <![CDATA[ <?php $mysqli = new mysqli("localhost", "my_user", "my_password", "world"); /* check connection */ if (mysqli_connect_errno()) { printf("Connect failed: %s\n", mysqli_connect_error()); exit(); } if ($stmt = $mysqli->prepare("SELECT Name FROM Country WHERE Name=? OR Code=?")) { $marker = $stmt->param_count; printf("Statement has %d markers.\n", $marker); /* close statement */ $stmt->close(); } /* close connection */ $mysqli->close(); ?> ]]> </programlisting> </example> <example> <title>Procedural style</title> <programlisting role="php"> <![CDATA[ <?php $link = mysqli_connect("localhost", "my_user", "my_password", "world"); /* check connection */ if (mysqli_connect_errno()) { printf("Connect failed: %s\n", mysqli_connect_error()); exit(); } if ($stmt = mysqli_prepare($link, "SELECT Name FROM Country WHERE Name=? OR Code=?")) { $marker = mysqli_stmt_param_count($stmt); printf("Statement has %d markers.\n", $marker); /* close statement */ mysqli_stmt_close($stmt); } /* close connection */ mysqli_close($link); ?> ]]> </programlisting> </example> <para> The above examples would produce the following output: </para> <screen> <![CDATA[ Statement has 2 markers. ]]> </screen> </refsect1> </refentry> <!-- Keep this comment at the end of the file Local variables: mode: sgml sgml-omittag:t sgml-shorttag:t sgml-minimize-attributes:nil sgml-always-quote-attributes:t sgml-indent-step:1 sgml-indent-data:t indent-tabs-mode:nil sgml-parent-document:nil sgml-default-dtd-file:"../../../../manual.ced" sgml-exposed-tags:nil sgml-local-catalogs:nil sgml-local-ecat-files:nil End: vim600: syn=xml fen fdm=syntax fdl=2 si vim: et tw=78 syn=sgml vi: ts=1 sw=1 --> http://cvs.php.net/co.php/phpdoc/en/reference/mysqli/functions/mysqli-stmt-prepare.xml?r=1.1&p=1 Index: phpdoc/en/reference/mysqli/functions/mysqli-stmt-prepare.xml +++ phpdoc/en/reference/mysqli/functions/mysqli-stmt-prepare.xml <?xml version="1.0" encoding="iso-8859-1"?> <!-- $Revision: 1.1 $ --> <refentry id="function.mysqli-stmt-prepare"> <refnamediv> <refname>mysqli_stmt_prepare</refname> <refname>stmt->prepare</refname> <refpurpose> Prepare a SQL statement for execution </refpurpose> </refnamediv> <refsect1> <title>Description</title> <para>Procedure style:</para> <methodsynopsis> <type>bool</type><methodname>mysqli_stmt_prepare</methodname> <methodparam><type>object</type><parameter>stmt</parameter></methodparam> <methodparam><type>string</type><parameter>query</parameter></methodparam> </methodsynopsis> <para>Object oriented style (method)</para> <classsynopsis> <ooclass><classname>stmt</classname></ooclass> <methodsynopsis> <type>mixed</type> <methodname>prepare</methodname> <methodparam><type>string</type><parameter>query</parameter></methodparam> </methodsynopsis> </classsynopsis> <para> <function>mysqli_stmt_prepare</function> prepares the SQL query pointed to by the null-terminated string query. The statement object has to be allocated by <function>mysqli_stmt_init</function>. The query must consist of a single SQL statement. </para> <note> <para> You should not add a terminating semicolon or <literal>\g</literal> to the statement. </para> </note> <para> The parameter <parameter>query</parameter> can include one or more parameter markers in the SQL statement by embedding question mark (<literal>?</literal>) characters at the appropriate positions. </para> <note> <para> The markers are legal only in certain places in SQL statements. For example, they are allowed in the VALUES() list of an INSERT statement (to specify column values for a row), or in a comparison with a column in a WHERE clause to specify a comparison value. </para> <para> However, they are not allowed for identifiers (such as table or column names), in the select list that names the columns to be returned by a SELECT statement), or to specify both operands of a binary operator such as the <literal>=</literal> equal sign. The latter restriction is necessary because it would be impossible to determine the parameter type. In general, parameters are legal only in Data Manipulation Languange (DML) statements, and not in Data Defination Language (DDL) statements. </para> </note> <para> The parameter markers must be bound to application variables using <function>mysqli_stmt_bind_param</function> and/or <function>mysqli_stmt_bind_result</function> before executing the statement or fetching rows. </para> </refsect1> <refsect1> &reftitle.returnvalues; <para> &return.success; </para> </refsect1> <refsect1> &reftitle.seealso; <para> <function>mysqli_stmt_init</function>, <function>mysqli_stmt_execute</function>, <function>mysqli_stmt_fetch</function>, <function>mysqli_stmt_bind_param</function>, <function>mysqli_stmt_bind_result</function>, <function>mysqli_stmt_close</function> </para> </refsect1> <refsect1> <title>Example</title> <example> <title>Object oriented style</title> <programlisting role="php"> <![CDATA[ <?php $mysqli = new mysqli("localhost", "my_user", "my_password", "world"); /* check connection */ if (mysqli_connect_errno()) { printf("Connect failed: %s\n", mysqli_connect_error()); exit(); } $city = "Amersfoort"; /* create a prepared statement */ $stmt = $mysqli->stmt_init(); if ($stmt->prepare("SELECT District FROM City WHERE Name=?")) { /* bind parameters for markers */ $stmt->bind_param("s", $city); /* execute query */ $stmt->execute(); /* bind result variables */ $stmt->bind_result($district); /* fetch value */ $stmt->fetch(); printf("%s is in district %s\n", $city, $district); /* close statement */ $stmt->close(); } /* close connection */ $mysqli->close(); ?> ]]> </programlisting> </example> <example> <title>Procedural style</title> <programlisting role="php"> <![CDATA[ <?php $link = mysqli_connect("localhost", "my_user", "my_password", "world"); /* check connection */ if (mysqli_connect_errno()) { printf("Connect failed: %s\n", mysqli_connect_error()); exit(); } $city = "Amersfoort"; /* create a prepared statement */ $stmt = mysqli_stmt_init(); if ($stmt = mysqli_stmt_prepare($stmt, "SELECT District FROM City WHERE Name=?")) { /* bind parameters for markers */ mysqli_stmt_bind_param($stmt, "s", $city); /* execute query */ mysqli_stmt_execute($stmt); /* bind result variables */ mysqli_stmt_bind_result($stmt, $district); /* fetch value */ mysqli_stmt_fetch($stmt); printf("%s is in district %s\n", $city, $district); /* close statement */ mysqli_stmt_close($stmt); } /* close connection */ mysqli_close($link); ?> ]]> </programlisting> </example> <para> The above examples would produce the following output: </para> <screen> <![CDATA[ Amersfoort is in district Utrecht ]]> </screen> </refsect1> </refentry> <!-- Keep this comment at the end of the file Local variables: mode: sgml sgml-omittag:t sgml-shorttag:t sgml-minimize-attributes:nil sgml-always-quote-attributes:t sgml-indent-step:1 sgml-indent-data:t indent-tabs-mode:nil sgml-parent-document:nil sgml-default-dtd-file:"../../../../manual.ced" sgml-exposed-tags:nil sgml-local-catalogs:nil sgml-local-ecat-files:nil End: vim600: syn=xml fen fdm=syntax fdl=2 si vim: et tw=78 syn=sgml vi: ts=1 sw=1 --> http://cvs.php.net/co.php/phpdoc/en/reference/mysqli/functions/mysqli-stmt-result-metadata.xml?r=1.1&p=1 Index: phpdoc/en/reference/mysqli/functions/mysqli-stmt-result-metadata.xml +++ phpdoc/en/reference/mysqli/functions/mysqli-stmt-result-metadata.xml <?xml version="1.0" encoding="iso-8859-1"?> <!-- $Revision: 1.1 $ --> <refentry id="function.mysqli-stmt-result-metadata"> <refnamediv> <refname>mysqli_stmt_result_metadata</refname> <refpurpose>returns result set metadata from a prepared statement</refpurpose> </refnamediv> <refsect1> <title>Description</title> <para>Procedural style:</para> <methodsynopsis> <type>mixed</type><methodname>mysqli_stmt_result_metadata</methodname> <methodparam><type>object</type><parameter>stmt</parameter></methodparam> </methodsynopsis> <para>Object oriented style (method):</para> <classsynopsis> <ooclass><classname>stmt</classname></ooclass> <methodsynopsis> <type>mixed</type> <methodname>get_metadata</methodname> <methodparam><type>void</type><parameter></parameter></methodparam> </methodsynopsis> </classsynopsis> <para> If a statement passed to <function>mysqli_prepare</function> is one that produces a result set, <function>mysqli_stmt_result_metadata</function> returns the result object that can be used to process the meta information such as total number of fields and individual field information. </para> <note> <para>This result set pointer can be passed as an argument to any of the field-based functions that process result set metadata, such as: <itemizedlist> <listitem><para><function>mysqli_num_fields</function></para></listitem> <listitem><para><function>mysqli_fetch_field</function></para></listitem> <listitem><para><function>mysqli_fetch_field_direct</function></para></listitem> <listitem><para><function>mysqli_fetch_fields</function></para></listitem> <listitem><para><function>mysqli_field_count</function></para></listitem> <listitem><para><function>mysqli_field_seek</function></para></listitem> <listitem><para><function>mysqli_field_tell</function></para></listitem> <listitem><para><function>mysqli_free_result</function></para></listitem> </itemizedlist> </para> </note> <para> The result set structure should be freed when you are done with it, which you can do by passing it to <function>mysqli_free_result</function> </para> <note> <para> The result set returned by <function>mysqli_stmt_result_metadata</function> contains only metadata. It does not contain any row results. The rows are obtained by using the statement handle with <function>mysqli_fetch</function>. </para> </note> </refsect1> <refsect1> &reftitle.returnvalues; <para> <function>mysqli_stmt_result_metadata</function> returns a result object or &false; if an error occured. </para> </refsect1> <refsect1> <title>See also:</title> <para> <function>mysqli_prepare</function>, <function>mysqli_free_result</function> </para> </refsect1> <refsect1> <title>Example</title> <para> <example> <title>Object oriented style</title> <programlisting role='php'> <![CDATA[ <?php $mysqli = new mysqli("localhost", "my_user", "my_password", "test"); $mysqli->query("DROP TABLE IF EXISTS friends"); $mysqli->query("CREATE TABLE friends (id int, name varchar(20))"); $mysqli->query("INSERT INTO friends VALUES (1,'Hartmut'), (2, 'Ulf')"); $stmt = $mysqli->prepare("SELECT id, name FROM friends"); $stmt->execute(); /* get resultset for metadata */ $result = $stmt->get_metadata(); /* retrieve field information from metadata result set */ $field = $result->fetch_field(); printf("Fieldname: %s\n", $field->name); /* close resultset */ $result->close(); /* close connection */ $mysqli->close(); ?> ]]> </programlisting> </example> <example> <title>Procedural style</title> <programlisting role='php'> <![CDATA[ <?php $link = mysqli_connect("localhost", "my_user", "my_password", "test"); mysqli_query($link, "DROP TABLE IF EXISTS friends"); mysqli_query($link, "CREATE TABLE friends (id int, name varchar(20))"); mysqli_query($link, "INSERT INTO friends VALUES (1,'Hartmut'), (2, 'Ulf')"); $stmt = mysqli_prepare($link, "SELECT id, name FROM friends"); mysqli_stmt_execute($stmt); /* get resultset for metadata */ $result = mysqli_stmt_result_metadata($stmt); /* retrieve field information from metadata result set */ $field = mysqli_fetch_field($result); printf("Fieldname: %s\n", $field->name); /* close resultset */ mysqli_free_result($result); /* close connection */ mysqli_close($link); ?> ]]> </programlisting> </example> </para> </refsect1> </refentry> <!-- Keep this comment at the end of the file Local variables: mode: sgml sgml-omittag:t sgml-shorttag:t sgml-minimize-attributes:nil sgml-always-quote-attributes:t sgml-indent-step:1 sgml-indent-data:t indent-tabs-mode:nil sgml-parent-document:nil sgml-default-dtd-file:"../../../../manual.ced" sgml-exposed-tags:nil sgml-local-catalogs:nil sgml-local-ecat-files:nil End: vim600: syn=xml fen fdm=syntax fdl=2 si vim: et tw=78 syn=sgml vi: ts=1 sw=1 --> http://cvs.php.net/co.php/phpdoc/en/reference/mysqli/functions/mysqli-stmt-send-long-data.xml?r=1.1&p=1 Index: phpdoc/en/reference/mysqli/functions/mysqli-stmt-send-long-data.xml +++ phpdoc/en/reference/mysqli/functions/mysqli-stmt-send-long-data.xml <?xml version="1.0" encoding="iso-8859-1"?> <!-- $Revision: 1.1 $ --> <refentry id="function.mysqli-stmt-send-long-data"> <refnamediv> <refname>mysqli_stmt_send_long_data</refname> <refname>stmt->send_long_data</refname> <refpurpose>Send data in blocks</refpurpose> </refnamediv> <refsect1> <title>Description</title> <para>Procedural style:</para> <methodsynopsis> <type>bool</type><methodname>mysqli_stmt_send_long_data</methodname> <methodparam><type>object</type><parameter>stmt</parameter></methodparam> <methodparam><type>int</type><parameter>param_nr</parameter></methodparam> <methodparam><type>string</type><parameter>data</parameter></methodparam> </methodsynopsis> <para>Object oriented style (method)</para> <classsynopsis> <ooclass><classname>stmt</classname></ooclass> <methodsynopsis> <type>bool</type><methodname>stmt_send_long_data</methodname> <methodparam><type>int</type><parameter>param_nr</parameter></methodparam> <methodparam><type>string</type><parameter>data</parameter></methodparam> </methodsynopsis> </classsynopsis> <para> Allows to send parameter data to the server in pieces (or chunks), e.g. if the size of a blob exceeds the size of <literal>max_allowed_packet</literal>. This function can be called multiple times to send the parts of a character or binary data value for a column, which must be one of the TEXT or BLOB datatypes. </para> <para> <parameter>param_nr</parameter> indicates which parameter to associate the data with. Parameters are numbered beginning with 0. data is a string containing data to be sent. </para> </refsect1> <refsect1> <title>Return values</title> <para>&return.success;</para> </refsect1> <refsect1> <title>See also</title> <para> <function>mysqli_prepare</function>, <function>mysqli_stmt_bind_param</function> </para> </refsect1> </refentry> <!-- Keep this comment at the end of the file Local variables: mode: sgml sgml-omittag:t sgml-shorttag:t sgml-minimize-attributes:nil sgml-always-quote-attributes:t sgml-indent-step:1 sgml-indent-data:t indent-tabs-mode:nil sgml-parent-document:nil sgml-default-dtd-file:"../../../../manual.ced" sgml-exposed-tags:nil sgml-local-catalogs:nil sgml-local-ecat-files:nil End: vim600: syn=xml fen fdm=syntax fdl=2 si vim: et tw=78 syn=sgml vi: ts=1 sw=1 -->