cvs: peardoc /en/package/database/mdb/mdb-common execute.xml executeQuery.xml

From: Date: Tue, 28 Oct 2003 20:29:23 +0000
Subject: cvs: peardoc /en/package/database/mdb/mdb-common execute.xml executeQuery.xml
Groups: php.pear.doc 
Request: Send a blank email to pear-doc+get-1795@lists.php.net to get a copy of this message
lsmith Tue Oct 28 15:29:23 2003 EDT Modified files: /peardoc/en/package/database/mdb/mdb-common execute.xml executeQuery.xml Log: fixed docs for the execute methods

Index: peardoc/en/package/database/mdb/mdb-common/execute.xml diff -u /dev/null peardoc/en/package/database/mdb/mdb-common/execute.xml:1.8 --- /dev/null Tue Oct 28 15:29:23 2003 +++ peardoc/en/package/database/mdb/mdb-common/execute.xml Tue Oct 28 15:29:23 2003 @@ -0,0 +1,236 @@ +<!-- $Revision: 1.8 $ --> +<refentry id="package.database.mdb.mdb-common.execute"> + <refnamediv> + <refname>MDB_Common::execute()</refname> + <refpurpose>executes a prepared SQL statment</refpurpose> + </refnamediv> + <refsynopsisdiv> + <funcsynopsis> + <funcsynopsisinfo> + require_once 'MDB.php'; + </funcsynopsisinfo> + <funcprototype> + <funcdef>mixed <function>execute</function> + </funcdef> + <paramdef>resource <parameter>$stmt</parameter> + </paramdef> + <paramdef> + array <parameter> + <optional>$types = &null;</optional> + </parameter> + </paramdef> + <paramdef> + array <parameter> + <optional>$params = array()</optional> + </parameter> + </paramdef> + <paramdef> + array <parameter> + <optional>$param_types = &null;</optional> + </parameter> + </paramdef> + </funcprototype> + </funcsynopsis> + </refsynopsisdiv> + <refsect1 id="package.database.mdb.mdb-common.execute.desc"> + &title.desc; + <para> + <function>execute</function> joins the prepared SQL statment from + <link linkend="package.database.mdb.mdb-common.prepareQuery"> + <function>prepareQuery</function> + </link> with the given data and executes the SQL query. + </para> + </refsect1> + <refsect1 id="package.database.mdb.mdb-common.execute.parameter"> + &title.param; + <para> + <variablelist> + <varlistentry> + <term> + &type.res; + <parameter>$stmt</parameter> + </term> + <listitem> + <para> + query handle from + <link linkend="package.database.mdb.mdb-common.prepareQuery"> + <function>prepareQuery</function> + </link> + </para> + </listitem> + </varlistentry> + <varlistentry> + <term> + &type.array; + <parameter>$types</parameter> + </term> + <listitem> + <para> + if supplied, the types of the columns in the result set will be set for fetching + </para> + </listitem> + </varlistentry> + <varlistentry> + <term> + &type.array; + <parameter>$params</parameter> + </term> + <listitem> + <para> + a numeric array containing the + data to insert into the query + </para> + </listitem> + </varlistentry> + <varlistentry> + <term> + &type.array; + <parameter>$param_types</parameter> + </term> + <listitem> + <para> + if supplied, the values in $param will automatically be set to the + passed datatypes + </para> + </listitem> + </varlistentry> + </variablelist> + </para> + </refsect1> + <refsect1 id="package.database.mdb.mdb-common.execute.return"> + &title.returns; + <para> + <parameter>mixed</parameter> - a resource id/&constant.mdb-ok; + or a &class.mdb-error;, if fail + </para> + </refsect1> + <refsect1 id="package.database.mdb.mdb-common.execute.throws"> + &title.throws; + <para> + <table> + <title>&title.throws.errortable;</title> + <tgroup cols="4"> + <thead> + <row> + <entry>Error code</entry> + <entry>Error message</entry> + <entry>Reason</entry> + <entry>Solution</entry> + </row> + </thead> + <tbody> + <row> + <entry> + <constant>MDB_ERROR_INVALID</constant> + </entry> + <entry> + &null; + </entry> + <entry> + SQL statment handle is not valid. + </entry> + <entry> + Check correct processing of the SQL statment with + <link linkend="package.database.mdb.mdb-common.prepareQuery"> + <function>prepareQuery</function> + </link>. Note that + <function>execute</function> requires a handle to the statement + returned by <link linkend="package.database.mdb.mdb-common.prepareQuery"> + <function>prepareQuery</function> + </link>, not the statment itself. + </entry> + </row> + <row> + <entry> + <constant>MDB_ERROR_NEED_MORE_DATA</constant> + </entry> + <entry> + &null; + </entry> + <entry> + To less data for filling the prepared SQL statment. + </entry> + <entry> + Check the number of wild cards given in the SQL statment for + <link linkend="package.database.mdb.mdb-common.prepareQuery"> + <function>prepareQuery</function> + </link>. Check the count of + entries in the array for <parameter>$data</parameter>. The count + of entries have to be equal to the number of wild cards. + </entry> + </row> + <row> + <entry> + <constant>MDB_ERROR_NO_DB_SELECTED</constant> + </entry> + <entry> + &null; + </entry> + <entry> + No database was choosen. + </entry> + <entry> + Check the <link linkend="package.database.mdb.intro-dsn">DSN</link> + in <link linkend="package.database.mdb.mdb.connect"> + <function>connect</function> + </link>. + </entry> + </row> + <row> + <entry>every other error code</entry> + <entry/> + <entry> + Database specific error + </entry> + <entry> + Check the database related section of + <ulink url="www.php.net/manual/">PHP-Manual</ulink> + to detect the reason for this error. In the most cases + a misformed SQL statment. Ie. using LIMIT in a SQL-Statment + for an Oracle database. + </entry> + </row> + </tbody> + </tgroup> + </table> + </para> + </refsect1> + <refsect1 id="package.database.mdb.mdb-common.execute.note"> + &title.note; + &note.notstatic; + <para> + See <link linkend="package.database.mdb.intro-execute"> + Introduction - Execute</link> for general using and an example. + </para> + </refsect1> + <refsect1 id="package.database.mdb.mdb-common.execute.see"> + &title.see; + <para> + <link linkend="package.database.mdb.mdb-common.prepareQuery"> + <function>prepareQuery</function> + </link>, + <link linkend="package.database.mdb.mdb-common.executemultiple"> + <function>executeMultiple</function> + </link> + </para> + </refsect1> +</refentry> +<!-- Keep this comment at the end of the file +Local variables: +mode: sgml +sgml-omittag:t +sgml-shorttag:t +sgml-minimize-attributes:nil +sgml-always-execute-attributes:t +sgml-indent-step:1 +sgml-indent-data:t +sgml-parent-document:nil +sgml-default-dtd-file:"../../../../../manual.ced" +sgml-exposed-tags:nil +sgml-local-catalogs:nil +sgml-local-ecat-files:nil +End: +vim600: syn=xml fen fdm=syntax fdl=2 si +vim: et tw=78 syn=sgml +vi: ts=1 sw=1 +--> Index: peardoc/en/package/database/mdb/mdb-common/executeQuery.xml diff -u peardoc/en/package/database/mdb/mdb-common/executeQuery.xml:1.1 peardoc/en/package/database/mdb/mdb-common/executeQuery.xml:1.2 --- peardoc/en/package/database/mdb/mdb-common/executeQuery.xml:1.1 Wed Sep 3 11:05:10 2003 +++ peardoc/en/package/database/mdb/mdb-common/executeQuery.xml Tue Oct 28 15:29:23 2003 @@ -1,4 +1,4 @@ -<!-- $Revision: 1.1 $ --> +<!-- $Revision: 1.2 $ --> <refentry id="package.database.mdb.mdb-common.executeQuery"> <refnamediv> <refname>MDB_Common::executeQuery()</refname> @@ -19,18 +19,6 @@ <optional>$types = &null;</optional> </parameter> </paramdef> - <paramdef> - array <parameter> - <optional>$params = array()</optional> - </parameter> - </paramdef> - <paramdef> - array <parameter> - <optional>$param_types = &null;</optional> - </parameter> - </paramdef> - <paramdef>array <parameter>$data</parameter> - </paramdef> </funcprototype> </funcsynopsis> </refsynopsisdiv> @@ -40,8 +28,8 @@ <function>executeQuery</function> joins the prepared SQL statment from <link linkend="package.database.mdb.mdb-common.prepareQuery"> <function>prepareQuery</function> - </link> with the given data and does the - SQL query. + </link> with the data that was set using one of the setParam() methods + and executes the SQL query. </para> </refsect1> <refsect1 id="package.database.mdb.mdb-common.executeQuery.parameter"> @@ -70,46 +58,6 @@ <listitem> <para> if supplied, the types of the columns in the result set will be set for fetching - </para> - </listitem> - </varlistentry> - <varlistentry> - <term> - &type.array; - <parameter>$params</parameter> - </term> - <listitem> - <para> - if supplied, - <link linkend="package.database.mdb.intro-executeQuery"> - <function>prepareQuery</function>/ - <function>executeQuery</function> - </link> will - be used with this array as - execute parameters - </para> - </listitem> - </varlistentry> - <varlistentry> - <term> - &type.array; - <parameter>$param_types</parameter> - </term> - <listitem> - <para> - if supplied, the values in $param will automatically set to the passed datatypes - </para> - </listitem> - </varlistentry> - <varlistentry> - <term> - &type.array; - <parameter>array $data</parameter> - </term> - <listitem> - <para> - a numeric array containing the - data to insert into the query </para> </listitem> </varlistentry>
« previous php.pear.doc (#1795) next »