Subject PHP and Interbase
Author Filip Szymanski
If I have posted the following question to the wrong list, please refer me
to the correct one.


I have difficulty in connecting?/executing a query from PHP 4.0 Release
Candidate 1 to Interbase 6.0 beta on the Linux Redhat 6.1 platform running
Apache 3.9.12. I have compiled PHP as a static module with the
"--with-interbase" option. The code below is almost identical to the
example in the PHP manual, and uses the example database installed with
Interbase 6.0:

<?php

$host = '/usr/interbase/examples/employee.gdb';
$dbh = ibase_connect($host, 'sysdba', 'masterkey');

$query = 'select * from employee';

$sth = ibase_query($dbh, $query);

while ($row = ibase_fetch_object($sth)) {
print $row->first_name . "\n";
}

ibase_close($dbh);

?>

From what I can tell, PHP is connecting fine to the database file (though
oddly enough doesn't seem to care about the username/password). When I open
the PHP file above in a browser, I get "The document contained no data" in
Netscape or "The page cannot be displayed" in IE. Commenting out "$sth =
ibase_query($dbh, $query);" gives the proper warning of "InterBase module: 0
is not result index in /www/index.php on line 16". Therefore I think there
is something happening with the ibase_query() function that is not right.

Any help would be greatly appreciated.

Filip