php-doc-en/reference/pdo/functions/PDO-prepare.xml
Jakub Vrana c58f007447 Change "object" to specific objects
git-svn-id: https://svn.php.net/repository/phpdoc/en/trunk@172548 c90b9560-bf6c-de11-be94-00142212c4b1
2004-11-12 13:16:17 +00:00

60 lines
1.8 KiB
XML

<?xml version='1.0' encoding='iso-8859-1'?>
<!-- $Revision: 1.2 $ -->
<!-- Generated by xml_proto.php v2.1. Found in /scripts directory of phpdoc. -->
<refentry id="function.PDO-prepare">
<refnamediv>
<refname>PDO::prepare</refname>
<refpurpose>
Prepares a statement for execution and returns a statement object
</refpurpose>
</refnamediv>
<refsect1>
<title>Description</title>
<methodsynopsis>
<type>PDOStatement</type><methodname>PDO::prepare</methodname>
<methodparam><type>string</type><parameter>statement</parameter></methodparam>
<methodparam choice="opt"><type>int</type><parameter>options</parameter></methodparam>
</methodsynopsis>
&warn.experimental.func;
<para>
Prepares an SQL statement to be executed by the statement-handle
<function>PDO::execute</function> method. The SQL statement can contain zero
or more named (:name) or question mark (?) parameter markers.
</para>
<example><title>Prepare and execute an SQL statement</title>
<programlisting role='php'>
<![CDATA[
<?php
/* Execute a prepared statement by passing an array of values */
$sth = $dbh->prepare('SELECT name, colour, calories
FROM fruit
WHERE calories < :calories AND colour = :colour');
$sth->execute(array(':calories' => 150, ':colour' => 'red'));
?>
]]>
</programlisting>
</example>
</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
-->