php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #38957 multiple prepares DO NOT WORK!
Submitted: 2006-09-26 06:30 UTC Modified: 2006-10-04 01:00 UTC
Votes:2
Avg. Score:5.0 ± 0.0
Reproduced:1 of 1 (100.0%)
Same Version:1 (100.0%)
Same OS:1 (100.0%)
From: xand_smirnov at mail dot ru Assigned:
Status: No Feedback Package: PDO related
PHP Version: 5.1.6 OS: Fedora 5
Private report: No CVE-ID: None
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If you forgot your password, you can retrieve your password here.
Password:
Status:
Package:
Bug Type:
Summary:
From: xand_smirnov at mail dot ru
New email:
PHP Version: OS:

 

 [2006-09-26 06:30 UTC] 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

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2006-09-26 07:09 UTC] tony2001@php.net
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


 [2006-10-04 01:00 UTC] php-bugs at lists dot php dot net
No feedback was provided for this bug for over a week, so it is
being suspended automatically. If you are able to provide the
information that was originally requested, please do so and change
the status of the bug back to "Open".
 
PHP Copyright © 2001-2025 The PHP Group
All rights reserved.
Last updated: Thu Jul 17 14:04:04 2025 UTC