cvs: peardoc /en/package/database/db intro-execute.xml

From: Date: Fri, 02 Apr 2004 21:16:51 +0000
Subject: cvs: peardoc /en/package/database/db intro-execute.xml
Groups: php.pear.doc 
Request: Send a blank email to pear-doc+get-3177@lists.php.net to get a copy of this message
danielc Fri Apr 2 16:16:51 2004 EDT Modified files: /peardoc/en/package/database/db intro-execute.xml Log: Break text up a bit for clarity. http://cvs.php.net/diff.php/peardoc/en/package/database/db/intro-execute.xml?r1=1.16&r2=1.17&ty=u Index: peardoc/en/package/database/db/intro-execute.xml diff -u peardoc/en/package/database/db/intro-execute.xml:1.16 peardoc/en/package/database/db/intro-execute.xml:1.17 --- peardoc/en/package/database/db/intro-execute.xml:1.16 Wed Mar 3 11:21:35 2004 +++ peardoc/en/package/database/db/intro-execute.xml Fri Apr 2 16:16:43 2004 @@ -1,4 +1,4 @@ -<!-- $Revision: 1.16 $ --> +<!-- $Revision: 1.17 $ --> <refentry id="package.database.db.intro-execute"> <refnamediv> <refname>Introduction - Prepare &amp; Execute</refname> @@ -123,6 +123,7 @@ ordered. The first entry of the array represents the first wildcard, the second the second wildcard etc. The order is independent from the used wildcard char. + <example> <title>Inserting data into a database</title> <programlisting role="php"> @@ -139,6 +140,7 @@ ]]> </programlisting> </example> + In the example the query is done four times: <programlisting role="sql"> <![CDATA[ @@ -148,10 +150,14 @@ INSERT INTO numbers VALUES ('4', 'four', 'fire') ]]> </programlisting> + </para> + + <para> <link linkend="package.database.db.db-common.executemultiple"> <function>executeMultiple</function></link> works in the same way, but requires a two dimensional array. So you can avoid the explicit foreach in the eample above. + <example> <title> Using <function>executeMultiple</function> instead of @@ -169,14 +175,19 @@ ]]> </programlisting> </example> + </para> + + <para> The result is the same. If one of the records failed, the unfinished records will not be executed. </para> + <para> If <link linkend="package.database.db.db-common.execute"> <function>execute*</function></link> fails a &class.db-error;, else &constant.db-ok; will returned. </para> + </refsect2> </refsect1>

« previous php.pear.doc (#3177) next »