Doc #66704 [NEW]: Small update needs to be made to the manual page
| From: | php_bugs at multiwebinc dot com | Date: | Wed, 12 Feb 2014 23:21:36 +0000 |
| Subject: | Doc #66704 [NEW]: Small update needs to be made to the manual page | ||
| Groups: | php.doc.bugs | ||
| Request: | Send a blank email to doc-bugs+get-10980@lists.php.net to get a copy of this message | ||
From: php_bugs at multiwebinc dot com
Operating system:
PHP version: 5.6Git-2014-02-12 (Git)
Package: Documentation problem
Bug Type: Documentation Problem
Bug description:Small update needs to be made to the manual page
Description:
------------
---
From manual page: http://www.php.net/pdo.query
---
From the PDO::query() and PDO::exec() manual pages it looks like they do
exactly the same thing with the only difference being the return value,
however reviewing the PHP source code, it appears that there is a subtle
difference that I feel should be noted.
Since PDO::query() internally does a prepare() followed by an execute(),
this means that the queries allowed must only contain syntax that is
listed in the list of "SQL Syntax Allowed in Prepared Statements"
(http://dev.mysql.com/doc/refman/5.6/en/sql-syntax-prepared-statements.html#idm46981480871472)
or else you get something like:
"SQLSTATE[HY000]: General error: 2030 This command is not supported in
the prepared statement protocol yet"
Test script:
---------------
<?php
// Note "USE" is not permitted in prepared statements (see the URL
above)
$dbh->query("USE db_name"); // Fails
$dbh->exec("USE db_name"); // Works
--
Edit bug report at https://bugs.php.net/bug.php?id=66704&edit=1
--
Try a snapshot (PHP 5.4): https://bugs.php.net/fix.php?id=66704&r=trysnapshot54
Try a snapshot (PHP 5.5): https://bugs.php.net/fix.php?id=66704&r=trysnapshot55
Try a snapshot (trunk): https://bugs.php.net/fix.php?id=66704&r=trysnapshottrunk
Fixed in SVN: https://bugs.php.net/fix.php?id=66704&r=fixed
Fixed in release: https://bugs.php.net/fix.php?id=66704&r=alreadyfixed
Need backtrace: https://bugs.php.net/fix.php?id=66704&r=needtrace
Need Reproduce Script: https://bugs.php.net/fix.php?id=66704&r=needscript
Try newer version: https://bugs.php.net/fix.php?id=66704&r=oldversion
Not developer issue: https://bugs.php.net/fix.php?id=66704&r=support
Expected behavior: https://bugs.php.net/fix.php?id=66704&r=notwrong
Not enough info: https://bugs.php.net/fix.php?id=66704&r=notenoughinfo
Submitted twice: https://bugs.php.net/fix.php?id=66704&r=submittedtwice
register_globals: https://bugs.php.net/fix.php?id=66704&r=globals
PHP 4 support discontinued: https://bugs.php.net/fix.php?id=66704&r=php4
Daylight Savings: https://bugs.php.net/fix.php?id=66704&r=dst
IIS Stability: https://bugs.php.net/fix.php?id=66704&r=isapi
Install GNU Sed: https://bugs.php.net/fix.php?id=66704&r=gnused
Floating point limitations: https://bugs.php.net/fix.php?id=66704&r=float
No Zend Extensions: https://bugs.php.net/fix.php?id=66704&r=nozend
MySQL Configuration Error: https://bugs.php.net/fix.php?id=66704&r=mysqlcfg