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