php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #36159 Running simple prepared statement SELECT fails (postgres)
Submitted: 2006-01-25 22:08 UTC Modified: 2006-02-09 01:00 UTC
From: edrozenberg at pobox dot com Assigned:
Status: No Feedback Package: PDO related
PHP Version: 5.1.2 OS: Windows XP SP2
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: edrozenberg at pobox dot com
New email:
PHP Version: OS:

 

 [2006-01-25 22:08 UTC] edrozenberg at pobox dot com
Description:
------------
Since upgrading PHP from 5.1.1 to 5.1.2, running a simple prepared statement SELECT fails.  Error info from print_r($stmt->errorInfo()): Array ( [0] => 00000 )

I have experienced no such problems on Linux 2.4 with PHP 5.1.2 compiled from source.



Reproduce code:
---------------
private function dbSel($query, $values)
{   
    $stmt = $this->dbh->prepare($query);
    if ( ! $stmt->execute($values) )
    {   
        print_r($stmt->errorInfo());
        $this->dbErrorGet($stmt);
        return(0);
    }
    $this->rows = $stmt->fetchAll(PDO::FETCH_ASSOC);
    return(1);      
}

----------------------------------------------------------
$query:  "SELECT * \n                     FROM t_workfile"
$values: array of <blank>

Expected result:
----------------
$stmt->execute($values) should return TRUE and
there should be rows that can be fetched

Actual result:
--------------
$stmt->execute($values) returns false and the print_r($stmt->errorInfo()) statement prints "Array ( [0] => 00000 )"

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2006-01-26 10:04 UTC] sniper@php.net
Please try using this CVS snapshot:

  http://snaps.php.net/php5.1-latest.tar.gz
 
For Windows:
 
  http://snaps.php.net/win32/php5.1-win32-latest.zip


 [2006-01-26 15:35 UTC] edrozenberg at pobox dot com
Just tried latest Windows snapshot 5.1.3-dev and have the same problem.  Reverting back to 5.1.1 fixes the problem.  I don't know how to trace the problem further and don't see any errors in any of the Apache logs.  My main server is Linux so this isn't a showstopper right now but there may be some bug here that needs to be gotten to the bottom of.
 [2006-01-29 19:33 UTC] sniper@php.net
Please try using this CVS snapshot:

  http://snaps.php.net/php5.1-latest.tar.gz
 
For Windows:
 
  http://snaps.php.net/win32/php5.1-win32-latest.zip

Something was just fixed.
 [2006-01-30 16:49 UTC] edrozenberg at pobox dot com
Same problem with latest Windows snap + php_pdo_pgsql.dll 	php-5.1.2 (5_1).
 [2006-02-01 17:55 UTC] iliaa@php.net
Works fine here, with $values value being either array() or null.
 [2006-02-09 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: Tue Apr 23 17:01:31 2024 UTC