|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
[2007-01-22 17:04 UTC] jrags at jasrags dot net
Description:
------------
getting a sql hydrate issue when attempting to retireive a result set from MySQL 5.0.26 on PHP 5.2.0. Specificly when using PARAM_BOOL. When i search for a specific 1 or 0 i can retrieve data.
Reproduce code:
---------------
$dbh = new PDO('mysql:host=localhost;dbname=test', $user, $pass);
$sql =
'SELECT
*
FROM
tbl_address
WHERE
tbl_address.is_active = ?';
$sth = $dbh->prepare($sql);
$sth->bindValue(1, true, PDO::PARAM_BOOL);
$sth->execute();
while($row = $sth->fetch(PDO::FETCH_NUM)) {
print_r($row);
}
Expected result:
----------------
I would expect data to be returned.
Actual result:
--------------
PDOException Description
SQLSTATE[HY000]: General error: 2053 Source File
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
|
|||||||||||||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Tue Oct 28 01:00:01 2025 UTC |
workaround that works for php/5.1.6 mysql/5.0.27 ------------------------------------------------ $dbh = new PDO('mysql:host=localhost;dbname=test', $user, $pass); $dbh->setAttribute( PDO::ATTR_EMULATE_PREPARES, true );