#36159 [Opn->Fbk]: Running simple prepared statement SELECT fails (postgres)
ID: 36159
Updated by: sniper@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:
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
Previous Comments:
------------------------------------------------------------------------
[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)