mirror of
https://github.com/sigmasternchen/php-doc-en
synced 2025-03-16 00:48:54 +00:00
changed description for mysqli_bind_param
removed constants git-svn-id: https://svn.php.net/repository/phpdoc/en/trunk@151074 c90b9560-bf6c-de11-be94-00142212c4b1
This commit is contained in:
parent
6173971f42
commit
51f301bb24
2 changed files with 39 additions and 40 deletions
|
@ -423,34 +423,6 @@
|
|||
</entry>
|
||||
<entry>Field is defined as <literal>GEOMETRY</literal></entry>
|
||||
</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>
|
||||
|
|
|
@ -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;
|
||||
|
|
Loading…
Reference in a new issue