Connecting to Firebird


 ibase_connect() 


The Firebird database is currently more an insider's tip than a widely in use database, but is getting more users and may be an alternative to established RDBMS. The origins of this database lie in Borland's InterBase product. Therefore, the extension is called ibase or interbase. So, Windows users need extension=php_interbase.dll in their php.ini, whereas "self-compilers" must configure PHP with the switch with-interbase=/path/to/firebird. Then, Firebird supports two modes: a file mode comparable to SQLite and a server mode. For the sake of interoperability and for an easy deployment, this section uses the file mode.

Connecting to InterBase/Firebird (ibase_connect.php)
 <?php   if ($db = ibase_connect('localhost:/tmp/quotes.gdb', 'user',   'password')) {     echo 'Connected to the database.';     ibase_close($db);   } else {     echo 'Connection failed.';   } ?> 

This section also uses .gdb files that are compatible with both Firebird and Interbase; the new Firebird format has the extension .fdb. After this file is created, ibase_connect() connects to the file or database. For the host, you have to provide a string in the format 'localhost:/path/to/file.gdb' when using TCP/IP, or the local filename (the listings assume that the file resides in /tmp on the local machine); you also need a username and a password.




PHP Phrasebook
PHP Phrasebook
ISBN: 0672328178
EAN: 2147483647
Year: 2005
Pages: 193

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net