dbs Wed May 3 15:22:00 2006 UTC
Modified files:
/phpdoc/en/reference/pdo/functions PDOStatement-execute.xml
Log:
Add an example for placeholders.
http://cvs.php.net/viewcvs.cgi/phpdoc/en/reference/pdo/functions/PDOStatement-execute.xml?r1=1.8&r2=1.9&diff_format=u
Index: phpdoc/en/reference/pdo/functions/PDOStatement-execute.xml
diff -u phpdoc/en/reference/pdo/functions/PDOStatement-execute.xml:1.8
phpdoc/en/reference/pdo/functions/PDOStatement-execute.xml:1.9
--- phpdoc/en/reference/pdo/functions/PDOStatement-execute.xml:1.8 Sun Jan
8 14:02:42 2006
+++ phpdoc/en/reference/pdo/functions/PDOStatement-execute.xml Wed May 3
15:22:00 2006
@@ -1,5 +1,5 @@
<?xml version='1.0' encoding='iso-8859-1'?>
-<!-- $Revision: 1.8 $ -->
+<!-- $Revision: 1.9 $ -->
<!-- Generated by xml_proto.php v2.1. Found in /scripts directory of phpdoc.
-->
<refentry id="function.PDOStatement-execute">
<refnamediv>
@@ -75,7 +75,7 @@
</programlisting>
</example>
- <example><title>Execute a prepared statement with an array of insert
values</title>
+ <example><title>Execute a prepared statement with an array of insert
values (named parameters)</title>
<programlisting role='php'>
<![CDATA[
<?php
@@ -91,6 +91,23 @@
</programlisting>
</example>
+ <example><title>Execute a prepared statement with an array of insert
values (placeholders)</title>
+ <programlisting role='php'>
+<![CDATA[
+<?php
+/* Execute a prepared statement by passing an array of insert values */
+$calories = 150;
+$colour = 'red';
+$sth = $dbh->prepare('SELECT name, colour, calories
+ FROM fruit
+ WHERE calories < ? AND colour = ?');
+$sth->execute(array($calories, $colour));
+?>
+]]>
+ </programlisting>
+ </example>
+
+
<example><title>Execute a prepared statement with question mark
placeholders</title>
<programlisting role='php'>
<![CDATA[