#36159 [Opn->Fbk]: Running simple prepared statement SELECT fails (postgres)
ID: 36159
Updated by: iliaa@php.net
Reported By: edrozenberg at pobox dot com
-Status: Open
+Status: Feedback
Bug Type: PDO related
Operating System: Windows XP SP2
PHP Version: 5.1.2
New Comment:
Works fine here, with $values value being either array() or null.
Previous Comments:
------------------------------------------------------------------------
[2006-01-30 16:49:32] edrozenberg at pobox dot com
Same problem with latest Windows snap + php_pdo_pgsql.dll php-5.1.2
(5_1).
------------------------------------------------------------------------
[2006-01-29 19:33:59] 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-26 15:35:36] 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-26 10:04:03] 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-25 22:08:13] 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 )"
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=36159&edit=1
Thread (6 messages)