Possible bug in PHP 5 (Interbase related)
Posted: Wed Jul 20, 2005 8:40 am
I'm trying to build an application that uses the Firebird (Interbase) database server, but I've recently run into the following problem:
I cannot seem to be able to return a result handle from a PHP function. I always get the following error when I attempt to run ibase_fetch_assoc () on the value returned from ibase_execute ().
Here is the sample code:
If I move the while-loop from lines 22 - 25 to line 8 above, everything works just fine...
WTF ?
Does anyone have any ideas ? Am I doing something wrong ?
Thanks in advance for any feedback !
EDIT: I tested this on PHP 5.0.2 and 5.0.4
phpinfo () - Interbase section says:
Firebird/InterBase Support dynamic
Compile-time Client Library Version Interbase 6
Run-time Client Library Version WI-V6.3.1.4481 Firebird 1.5
I cannot seem to be able to return a result handle from a PHP function. I always get the following error when I attempt to run ibase_fetch_assoc () on the value returned from ibase_execute ().
Code: Select all
Warning: ibase_fetch_assoc(): 4 is not a valid Firebird/InterBase result resource
in D:\WWW\test_ibase.php on line 22Code: Select all
<?php
echo ("<pre>");
function do_query ($dbc, $sql)
{
$stmt = ibase_prepare ($dbc, $sql);
$res = ibase_execute ($stmt);
return $res;
}
$db = "localhost:d:/www/ibtest.gdb";
$user = "SYSDBA";
$password = "masterkey";
$dbc = ibase_connect ($db, $user, $password);
$sql = "SELECT * FROM test";
$res = do_query ($dbc, $sql);
while ($row = ibase_fetch_assoc ($res))
{
print_r ($row);
}
?>WTF ?
Does anyone have any ideas ? Am I doing something wrong ?
Thanks in advance for any feedback !
EDIT: I tested this on PHP 5.0.2 and 5.0.4
phpinfo () - Interbase section says:
Firebird/InterBase Support dynamic
Compile-time Client Library Version Interbase 6
Run-time Client Library Version WI-V6.3.1.4481 Firebird 1.5