georg Wed Feb 11 03:10:47 2004 EDT
Modified files:
/phpdoc/en/reference/mysqli constants.xml
/phpdoc/en/reference/mysqli/functions mysqli-bind-param.xml
Log:
changed description for mysqli_bind_param
removed constants
http://cvs.php.net/diff.php/phpdoc/en/reference/mysqli/constants.xml?r1=1.3&r2=1.4&ty=u
Index: phpdoc/en/reference/mysqli/constants.xml
diff -u phpdoc/en/reference/mysqli/constants.xml:1.3
phpdoc/en/reference/mysqli/constants.xml:1.4
--- phpdoc/en/reference/mysqli/constants.xml:1.3 Wed Jan 28 18:19:38 2004
+++ phpdoc/en/reference/mysqli/constants.xml Wed Feb 11 03:10:45 2004
@@ -425,34 +425,6 @@
</row>
<row>
<entry>
- <constant id='constantmysqli-bind-string'>MYSQLI_BIND_STRING</constant>
- (<link linkend='language.types.integer'>integer</link>)
- </entry>
- <entry>Bind variable has type <literal>STRING</literal></entry>
- </row>
- <row>
- <entry>
- <constant id='constantmysqli-bind-int'>MYSQLI_BIND_INT</constant>
- (<link linkend='language.types.integer'>integer</link>)
- </entry>
- <entry>Bind variable has type <literal>INT</literal></entry>
- </row>
- <row>
- <entry>
- <constant id='constantmysqli-bind-double'>MYSQLI_BIND_DOUBLE</constant>
- (<link linkend='language.types.integer'>integer</link>)
- </entry>
- <entry>Bind variable has type <literal>DOUBLE</literal></entry>
- </row>
- <row>
- <entry>
- <constant id='constantmysqli-bind-send-data'>MYSQLI_BIND_SEND_DATA</constant>
- (<link linkend='language.types.integer'>integer</link>)
- </entry>
- <entry>Sending bind variable in chunks</entry>
- </row>
- <row>
- <entry>
<constant id='constantmysqli-need-data'>MYSQLI_NEED_DATA</constant>
(<link linkend='language.types.integer'>integer</link>)
</entry>
http://cvs.php.net/diff.php/phpdoc/en/reference/mysqli/functions/mysqli-bind-param.xml?r1=1.4&r2=1.5&ty=u
Index: phpdoc/en/reference/mysqli/functions/mysqli-bind-param.xml
diff -u phpdoc/en/reference/mysqli/functions/mysqli-bind-param.xml:1.4
phpdoc/en/reference/mysqli/functions/mysqli-bind-param.xml:1.5
--- phpdoc/en/reference/mysqli/functions/mysqli-bind-param.xml:1.4 Wed Jan 28
18:18:42 2004
+++ phpdoc/en/reference/mysqli/functions/mysqli-bind-param.xml Wed Feb 11 03:10:47
2004
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="iso-8859-1"?>
-<!-- $Revision: 1.4 $ -->
+<!-- $Revision: 1.5 $ -->
<refentry id="function.mysqli-bind-param">
<refnamediv>
<refname>mysqli_bind_param</refname>
@@ -12,7 +12,7 @@
<methodsynopsis>
<type>bool</type><methodname>mysqli_bind_param</methodname>
<methodparam><type>object</type><parameter>stmt</parameter></methodparam>
- <methodparam><type>array</type><parameter>types</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>
@@ -31,19 +31,48 @@
<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 array <parameter>types</parameter> specifies the types for the
- diffrent bind variables. Valid array values are MYSQLI_BIND_INT,
MYSQLI_BIND_DOUBLE,
- MYSQLI_BIND_STRING and MYSQLI_SEND_DATA.
+ 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 MYSQLI_SEND_DATA and use
+ (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 array values must match the number of
- parameters in the statement.
+ The number of variables and length of
+ string <parameter>types</parameter> must match the parameters in the statement.
</para>
</note>
</refsect1>
@@ -70,8 +99,7 @@
/* prepare statement and bind variables for insert statements */
$stmt = mysqli_prepare($link, "INSERT INTO mytable VALUES (?, ?, ?)");
- mysqli_bind_param($stmt, array(MYSQLI_BIND_INT, MYSQLI_BIND_INT,
- MYSQLI_BIND_STRING), $a, $b, $c);
+ mysqli_bind_param("iis", $a, $b, $c);
$a = 1;
$b = 2;
@@ -92,8 +120,7 @@
/* prepare statement and bind parameters */
$stmt = $mysql->prepare("INSERT INTO mytable VALUES (?, ?, ?)");
- $stmt->bind_param(array(MYSQLI_BIND_INT, MYSQLI_BIND_INT,
- MYSQLI_BIND_STRING), $a, $b, $c);
+ $stmt->bind_param("iis", $a, $b, $c);
$a = 1;
$b = 2;