cvs: peardoc /en/package/database/db intro-execute.xml
| From: | Daniel Convissor | Date: | Sun, 22 Feb 2004 03:37:01 +0000 |
| Subject: | cvs: peardoc /en/package/database/db intro-execute.xml | ||
| Groups: | php.pear.doc | ||
| Request: | Send a blank email to pear-doc+get-2669@lists.php.net to get a copy of this message | ||
danielc Sat Feb 21 22:37:01 2004 EDT
Modified files:
/peardoc/en/package/database/db intro-execute.xml
Log:
Misplaced }'s and some whitespace.
http://cvs.php.net/diff.php/peardoc/en/package/database/db/intro-execute.xml?r1=1.13&r2=1.14&ty=u
Index: peardoc/en/package/database/db/intro-execute.xml
diff -u peardoc/en/package/database/db/intro-execute.xml:1.13
peardoc/en/package/database/db/intro-execute.xml:1.14
--- peardoc/en/package/database/db/intro-execute.xml:1.13 Thu Feb 5 00:07:57 2004
+++ peardoc/en/package/database/db/intro-execute.xml Sat Feb 21 22:37:01 2004
@@ -1,4 +1,4 @@
-<!-- $Revision: 1.13 $ -->
+<!-- $Revision: 1.14 $ -->
<refentry id="package.database.db.intro-execute">
<refnamediv>
<refname>Introduction - Prepare & Execute</refname>
@@ -61,8 +61,8 @@
<programlisting>
<![CDATA[
SELECT surname, name, age
- FROM person
- WHERE name = 'name_to_find' AND age < 'age_limit'
+ FROM person
+ WHERE name = 'name_to_find' AND age < 'age_limit'
]]>
</programlisting>
Now check which parameters should be replaced while script
@@ -70,8 +70,8 @@
<programlisting>
<![CDATA[
SELECT surname, name, age
- FROM person
- WHERE name = ? AND age < ?
+ FROM person
+ WHERE name = ? AND age < ?
]]>
</programlisting>
So, thats all! Now you have a generic statement, required by
@@ -125,7 +125,8 @@
$sth = $db->prepare('INSERT INTO numbers VALUES (?, ?, ?)');
foreach ($alldata as $row) {
$db->execute($sth, $row);
-]]>
+}
+ ]]>
</programlisting>
</example>
In the example the query is done four times:
@@ -155,7 +156,7 @@
array(4, 'four', 'fire'));
$sth = $db->prepare('INSERT INTO numbers VALUES (?, ?, ?)');
$db->executeMultiple($sth, $alldata);
-]]>
+ ]]>
</programlisting>
</example>
The result is the same. If one of the records failed, the