vrana Wed Feb 8 15:29:02 2006 UTC
Modified files: /phpdoc/en/reference/pdo reference.xml Log: Example of invalid use of placeholder (bug #36281) http://cvs.php.net/viewcvs.cgi/phpdoc/en/reference/pdo/reference.xml?r1=1.49&r2=1.50&diff_format=u Index: phpdoc/en/reference/pdo/reference.xml diff -u phpdoc/en/reference/pdo/reference.xml:1.49 phpdoc/en/reference/pdo/reference.xml:1.50 --- phpdoc/en/reference/pdo/reference.xml:1.49 Mon Jan 16 00:53:32 2006 +++ phpdoc/en/reference/pdo/reference.xml Wed Feb 8 15:29:02 2006 @@ -1,5 +1,5 @@ <?xml version='1.0' encoding='iso-8859-1'?> -<!-- $Revision: 1.49 $ --> +<!-- $Revision: 1.50 $ --> <!-- Purpose: database.abstract --> <!-- Membership: pecl, bundled --> @@ -618,6 +618,22 @@ </programlisting> </example> </para> + <para> + <example><title>Invalid use of placeholder</title> + <programlisting role='php'> +<![CDATA[ +<?php +$stmt = $dbh->prepare("SELECT * FROM REGISTRY where name LIKE '%?%'"); +$stmt->execute(array($_GET['name'])); + +// placeholder must be used in the place of the whole value +$stmt = $dbh->prepare("SELECT * FROM REGISTRY where name LIKE ?"); +$stmt->execute(array("%$_GET[name]%")); +?> +]]> + </programlisting> + </example> + </para> </section> <section id='pdo.error-handling'>