mirror of
https://github.com/sigmasternchen/php-doc-en
synced 2025-03-16 08:58:56 +00:00
Clarify restrictions on binding parameters.
Correct return type of PDO::prepare. git-svn-id: https://svn.php.net/repository/phpdoc/en/trunk@204829 c90b9560-bf6c-de11-be94-00142212c4b1
This commit is contained in:
parent
3c24d3ebe2
commit
5067472b93
2 changed files with 41 additions and 3 deletions
|
@ -1,5 +1,5 @@
|
|||
<?xml version='1.0' encoding='iso-8859-1'?>
|
||||
<!-- $Revision: 1.9 $ -->
|
||||
<!-- $Revision: 1.10 $ -->
|
||||
<!-- Generated by xml_proto.php v2.1. Found in /scripts directory of phpdoc. -->
|
||||
<refentry id="function.PDO-prepare">
|
||||
<refnamediv>
|
||||
|
@ -11,7 +11,7 @@
|
|||
<refsect1 role="description">
|
||||
&reftitle.description;
|
||||
<methodsynopsis>
|
||||
<type>PDOStatement</type><methodname>PDO::prepare</methodname>
|
||||
<type>mixed</type><methodname>PDO::prepare</methodname>
|
||||
<methodparam><type>string</type><parameter>statement</parameter></methodparam>
|
||||
<methodparam choice="opt"><type>array</type><parameter>driver_options</parameter></methodparam>
|
||||
</methodsynopsis>
|
||||
|
@ -24,6 +24,13 @@
|
|||
You cannot use both named and question mark parameter markers within the same
|
||||
SQL statement; pick one or the other parameter style.
|
||||
</para>
|
||||
<para>
|
||||
You must include a unique parameter marker for each value you wish to pass
|
||||
in to the statement when you call <function>PDOStatement::execute</function>.
|
||||
You cannot use a named parameter marker of the same name twice in a prepared
|
||||
statement. You cannot bind multiple values to a single named parameter in,
|
||||
for example, the IN() clause of an SQL statement.
|
||||
</para>
|
||||
<para>
|
||||
Calling <function>PDO::prepare</function> and
|
||||
<function>PDOStatement::execute</function> for statements that will be
|
||||
|
@ -75,6 +82,8 @@
|
|||
<para>
|
||||
If the database server successfully prepares the statement,
|
||||
<function>PDO::prepare</function> returns a PDOStatement object.
|
||||
If the database server cannot successfully prepare the statement,
|
||||
<function>PDO::prepare</function> returns &false;.
|
||||
</para>
|
||||
</refsect1>
|
||||
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
<?xml version='1.0' encoding='iso-8859-1'?>
|
||||
<!-- $Revision: 1.7 $ -->
|
||||
<!-- $Revision: 1.8 $ -->
|
||||
<!-- Generated by xml_proto.php v2.1. Found in /scripts directory of phpdoc. -->
|
||||
<refentry id="function.PDOStatement-execute">
|
||||
<refnamediv>
|
||||
|
@ -26,6 +26,35 @@
|
|||
</para>
|
||||
</refsect1>
|
||||
|
||||
<refsect1 role="parameters">
|
||||
&reftitle.parameters;
|
||||
<para>
|
||||
<variablelist>
|
||||
<varlistentry>
|
||||
<term><parameter>input-parameters</parameter></term>
|
||||
<listitem>
|
||||
<para>
|
||||
An array of values with as many elements as there are bound
|
||||
parameters in the SQL statement being executed.
|
||||
</para>
|
||||
<para>
|
||||
You cannot bind multiple values to a single parameter; for example,
|
||||
you cannot bind two values to a single named parameter in an IN()
|
||||
clause.
|
||||
</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
</variablelist>
|
||||
</para>
|
||||
</refsect1>
|
||||
|
||||
<refsect1 role="returnvalues">
|
||||
&reftitle.returnvalues;
|
||||
<para>
|
||||
&return.success;
|
||||
</para>
|
||||
</refsect1>
|
||||
|
||||
<refsect1 role="examples">
|
||||
&reftitle.examples;
|
||||
<example><title>Execute a prepared statement with bound variables</title>
|
||||
|
|
Loading…
Reference in a new issue