Testing

<< Build and installation | Setting up PHP and Firebird on Linux | A. Document history >>

Testing

Run the following script. Make sure that the Firebird example employee database is at the location specified in $dbname.

 <?php

 header("Content-Type: text/plain");

 $dbname = '/opt/firebird/examples/empbuild/employee.fdb';

 $dbuser = '';

 $dbpassword = '';

 $res = ibase_connect($dbname, $dbuser, $dbpass) or

 die(ibase_errmsg());
 #
 #
 $sql = "SELECT * FROM Country";

 $result = ibase_query($res, $sql) or die(ibase_errmsg());

 echo ibase_num_fields($result);

 while($row=ibase_fetch_object($result))

 {
   printf("%-15s %s\n", $row->COUNTRY, $row->CURRENCY); 
 }

 ibase_free_result($result);

 ibase_close($res) or die(ibase_errmsg());

 ?>

See also:
Beginners' guide to Firebird and PHP
Using Apache™, PHP and InterBase® to develop websites

back to top of page
<< Build and installation | Setting up PHP and Firebird on Linux | A. Document history >>