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
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
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

Add a Patch

Pull Requests

Add a Pull Request

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-2024 The PHP Group
All rights reserved.
Last updated: Mon Apr 29 19:01:30 2024 UTC