#38957 [Opn->Fbk]: multiple prepares DO NOT WORK!
| From: | tony2001@php.net | Date: | Tue, 26 Sep 2006 07:09:54 +0000 |
| Subject: | #38957 [Opn->Fbk]: multiple prepares DO NOT WORK! | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-102676@lists.php.net to get a copy of this message | ||
ID: 38957
Updated by: tony2001@php.net
Reported By: xand_smirnov at mail dot ru
-Status: Open
+Status: Feedback
Bug Type: PDO related
Operating System: Fedora 5
PHP Version: 5.1.6
New Comment:
Please try using this CVS snapshot:
http://snaps.php.net/php5.2-latest.tar.gz
For Windows:
http://snaps.php.net/win32/php5.2-win32-latest.zip
Previous Comments:
------------------------------------------------------------------------
[2006-09-26 06:30:27] xand_smirnov at mail dot ru
Description:
------------
Second prepare() returns no object so execute() ends with
PHP Fatal error: Call to a member function execute() on a non-object
in
Reproduce code:
---------------
$stmt = $dbh->prepare("SELECT d_pk FROM d WHERE t=1");
print_r($stmt);
$stmt->execute();
$stmt = $dbh->prepare("SELECT d_pk FROM d WHERE t=2");
print_r($stmt);
$stmt->execute();
Expected result:
----------------
PDOStatement Object
(
[queryString] => SELECT d_pk FROM d WHERE type=1
)
PDOStatement Object
(
[queryString] => SELECT d_pk FROM d WHERE type=2
)
Actual result:
--------------
PDOStatement Object
(
[queryString] => SELECT d_pk FROM d WHERE type=1
)
PHP Fatal error: Call to a member function execute() on a non-object
in
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=38957&edit=1