cvs: phpdoc /en/reference/pdo/pdostatement debugdumpparams.xml

From: Date: Wed, 29 Apr 2009 15:33:25 +0000
Subject: cvs: phpdoc /en/reference/pdo/pdostatement debugdumpparams.xml
Groups: php.doc.cvs 
Request: Send a blank email to doc-cvs+get-3915@lists.php.net to get a copy of this message
dams Wed Apr 29 15:33:25 2009 UTC Added files: /phpdoc/en/reference/pdo/pdostatement debugdumpparams.xml Log: added docs http://cvs.php.net/viewvc.cgi/phpdoc/en/reference/pdo/pdostatement/debugdumpparams.xml?view=markup&rev=1.1 Index: phpdoc/en/reference/pdo/pdostatement/debugdumpparams.xml +++ phpdoc/en/reference/pdo/pdostatement/debugdumpparams.xml <?xml version='1.0' encoding='iso-8859-1'?> <!-- $Revision: 1.1 $ --> <refentry xml:id="pdostatement.debugdumpparams" xmlns="http://docbook.org/ns/docbook"> <refnamediv> <refname>PDOStatement::debugDumpParams</refname> <refpurpose> Dump a SQL prepared command </refpurpose> </refnamediv> <refsect1 role="description"> &reftitle.description; <methodsynopsis> <type>bool</type><methodname>PDOStatement::debugDumpParams</methodname> <void /> </methodsynopsis> <para> Dumps the informations contained by a prepared statement directly on the output. It will provide the <literal>SQL</literal> query in use, the number of parameters used (<literal>Params</literal>), the list of parameters, with their name, type (<literal>paramtype</literal>) as an integer, their key name or position, the value, and the position in the query (if this is supported by the PDO driver, otherwise, it will be -1). </para> <para> This is a debug function, which dump directly the data on the normal output. &tip.ob-capture; </para> <para> This will only dumps the parameters in the statment at the moment of the dump. Extra parameters are not stored in the statement, and not displayed. </para> </refsect1> <refsect1 role="returnvalues"> &reftitle.returnvalues; <para> &return.void; </para> </refsect1> <refsect1 role="examples"> &reftitle.examples; <example> <title><function>PDOStatement::debugDumpParams</function> example with named parameters</title> <programlisting role='php'> <![CDATA[ <?php /* Execute a prepared statement by binding PHP variables */ $calories = 150; $colour = 'red'; $sth = $dbh->prepare('SELECT name, colour, calories FROM fruit WHERE calories < :calories AND colour = :colour'); $sth->bindParam(':calories', $calories, PDO::PARAM_INT); $sth->bindValue(':colour', $colour, PDO::PARAM_STR, 12); $sth->execute(); $sth->debugDumpParams(); ?> ]]> </programlisting> &example.outputs; <screen> <![CDATA[ SQL: [96] SELECT name, colour, calories FROM fruit WHERE calories < :calories AND colour = :colour Params: 2 Key: Name: [9] :calories paramno=-1 name=[9] ":calories" is_param=1 param_type=1 Key: Name: [7] :colour paramno=-1 name=[7] ":colour" is_param=1 param_type=2 ]]> </screen> </example> <example> <title><function>PDOStatement::debugDumpParams</function> example with unnamed parameters</title> <programlisting role='php'> <![CDATA[ <?php /* Execute a prepared statement by binding PHP variables */ $calories = 150; $colour = 'red'; $name = 'apple'; $sth = $dbh->prepare('SELECT name, colour, calories FROM fruit WHERE calories < ? AND colour = ?'); $sth->bindParam(1, $calories, PDO::PARAM_INT); $sth->bindValue(2, $colour, PDO::PARAM_STR); $sth->execute(); $sth->debugDumpParams(); ?> ]]> </programlisting> &example.outputs; <screen> <![CDATA[ SQL: [82] SELECT name, colour, calories FROM fruit WHERE calories < ? AND colour = ? Params: 2 Key: Position #0: paramno=0 name=[0] "" is_param=1 param_type=1 Key: Position #1: paramno=1 name=[0] "" is_param=1 param_type=2 ]]> </screen> </example> </refsect1> <refsect1 role="seealso"> &reftitle.seealso; <para> <simplelist> <member><function>PDO::prepare</function></member> <member><function>PDOStatement::bindParam</function></member> <member><function>PDOStatement::bindValue</function></member> </simplelist> </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-quote-attributes:t sgml-indent-step:1 sgml-indent-data:t indent-tabs-mode:nil 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 -->

« previous php.doc.cvs (#3915) next »