note 57394 added to function.pdo-query
| From: | AJG at osu1 dot php dot net | Date: | Mon, 03 Oct 2005 02:50:07 +0000 |
| Subject: | note 57394 added to function.pdo-query | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-96223@lists.php.net to get a copy of this message | ||
PDO::query() seems to return FALSE when there is an error, instead of a PDOStatement object. This is
a problem, because then you can't access the errorCode and errorInfo for that query.
This is a bug, as the return value should be always an object. I'm using PDO RC1 with PDO_MYSQL
RC1, via dl(). Your mileage may vary.
The workaround I'm trying is to use prepared statements, which are more trouble than a simple
query() method.
----
Manual Page -- http://www.php.net/manual/en/function.pdo-query.php
Edit -- http://master.php.net/manage/user-notes.php?action=edit+57394
Delete: added to the manual -- http://master.php.net/manage/user-notes.php?action=delete+57394&report=yes&reason=added+to+the+manual
Delete: bad code -- http://master.php.net/manage/user-notes.php?action=delete+57394&report=yes&reason=bad+code
Delete: spam -- http://master.php.net/manage/user-notes.php?action=delete+57394&report=yes&reason=spam
Delete: useless -- http://master.php.net/manage/user-notes.php?action=delete+57394&report=yes&reason=useless
Delete: non-english -- http://master.php.net/manage/user-notes.php?action=delete+57394&report=yes&reason=non-english
Delete: already in docs -- http://master.php.net/manage/user-notes.php?action=delete+57394&report=yes&reason=already+in+docs
Delete: other reasons -- http://master.php.net/manage/user-notes.php?action=delete+57394&report=yes
Reject -- http://master.php.net/manage/user-notes.php?action=reject+57394&report=yes
Search -- http://master.php.net/manage/user-notes.php