dbs Sun Jan 8 14:02:42 2006 UTC
Modified files: /phpdoc/en/reference/pdo/functions PDO-prepare.xml PDOStatement-execute.xml Log: Clarify restrictions on binding parameters. Correct return type of PDO::prepare. http://cvs.php.net/viewcvs.cgi/phpdoc/en/reference/pdo/functions/PDO-prepare.xml?r1=1.9&r2=1.10&diff_format=u Index: phpdoc/en/reference/pdo/functions/PDO-prepare.xml diff -u phpdoc/en/reference/pdo/functions/PDO-prepare.xml:1.9 phpdoc/en/reference/pdo/functions/PDO-prepare.xml:1.10 --- phpdoc/en/reference/pdo/functions/PDO-prepare.xml:1.9 Tue Sep 20 08:22:29 2005 +++ phpdoc/en/reference/pdo/functions/PDO-prepare.xml Sun Jan 8 14:02:42 2006 @@ -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> @@ -25,6 +25,13 @@ 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 issued multiple times with different parameter values optimizes the @@ -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> http://cvs.php.net/viewcvs.cgi/phpdoc/en/reference/pdo/functions/PDOStatement-execute.xml?r1=1.7&r2=1.8&diff_format=u Index: phpdoc/en/reference/pdo/functions/PDOStatement-execute.xml diff -u phpdoc/en/reference/pdo/functions/PDOStatement-execute.xml:1.7 phpdoc/en/reference/pdo/functions/PDOStatement-execute.xml:1.8 --- phpdoc/en/reference/pdo/functions/PDOStatement-execute.xml:1.7 Tue Sep 20 08:22:29 2005 +++ phpdoc/en/reference/pdo/functions/PDOStatement-execute.xml Sun Jan 8 14:02:42 2006 @@ -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>