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
Anyone can comment on a bug. Have a simpler test case? Does it work for you on a different platform? Let us know!
Just going to say 'Me too!'? Don't clutter the database with that please !
Your email address:
MUST BE VALID
Solve the problem:
35 - 2 = ?
Subscribe to this entry?

 
 [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-2024 The PHP Group
All rights reserved.
Last updated: Thu Oct 31 23:01:28 2024 UTC