#35386 [Asn->Fbk]: first row is null
| From: | sniper@php.net | Date: | Thu, 22 Dec 2005 09:38:04 +0000 |
| Subject: | #35386 [Asn->Fbk]: first row is null | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-90861@lists.php.net to get a copy of this message | ||
ID: 35386
Updated by: sniper@php.net
Reported By: slapaf at hotmail dot com
-Status: Assigned
+Status: Feedback
Bug Type: PDO related
Operating System: winxp sp2
PHP Version: 5.1.0
Assigned To: abies
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:
------------------------------------------------------------------------
[2005-11-25 11:58:10] tony2001@php.net
Assigned to the maintainer.
------------------------------------------------------------------------
[2005-11-25 11:55:38] slapaf at hotmail dot com
deleting row with "name 1" and inserting a "name 5" returns:
NULL :
string : name 3
string : name 4
string : name 5
------------------------------------------------------------------------
[2005-11-25 11:48:44] slapaf at hotmail dot com
array(2) {
["EVENT_NAME"]=>
NULL
[0]=>
NULL
}
array(2) {
["EVENT_NAME"]=>
string(6) "name 2"
[0]=>
string(6) "name 2"
}
array(2) {
["EVENT_NAME"]=>
string(6) "name 3"
[0]=>
string(6) "name 3"
}
array(2) {
["EVENT_NAME"]=>
string(6) "name 4"
[0]=>
string(6) "name 4"
}
------------------------------------------------------------------------
[2005-11-25 11:44:58] tony2001@php.net
Change this line:
print '<pre>'.gettype($row['EVENT_NAME']).' :
'.$row['EVENT_NAME'];
to
var_dump($row);
and paste the result here.
------------------------------------------------------------------------
[2005-11-25 11:38:32] slapaf at hotmail dot com
Description:
------------
When using PDO for simple query in Firebird it returns first row as
null.
I've tried using ADODB for control and it returns the correct results.
Reproduce code:
---------------
$dbh = new PDO("firebird:dbname=localhost:test.fdb","****","******");
$sql='SELECT EVENT_NAME FROM EVENTS';
foreach($dbh->query($sql) as $row){
print '<pre>'.gettype($row['EVENT_NAME']).' :
'.$row['EVENT_NAME'];
}
Expected result:
----------------
string : name 1
string : name 2
string : name 3
string : name 4
Actual result:
--------------
NULL :
string : name 2
string : name 3
string : name 4
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=35386&edit=1