If you have a database alias on the server "localhost" called "test.fdb", you can do:
$conn = new PDO("firebird:dbname=localhost:test.fdb",
'SYSDBA','letmein');
Note that as of the time of writing, the Firebird driver doesn't correctly throw an exception on connection error
http://bugs.php.net/bug.php?id=41522
Firebird/Interbase Functions (PDO_FIREBIRD)
Introducción
Esta extensión es EXPERIMENTAL. Esto significa que el comportamiento de esta extensión, los nombre de sus funciones y en definitiva TODO lo documentado sobre esta extensión, puede cambiar en una futura versión de PHP SIN AVISO. La advertencia queda hecha, y utilizar esta extensión queda bajo su propia responsabilidad.
Instalación
Use --with-pdo-firebird[=DIR] to install the PDO Firebird extension, where the optional [=DIR] is the Firebird base install directory.
$ ./configure --with-pdo-firebird
Constantes predefinidas
Estas constantes están definidas por este driver, y estarán disponibles sólo cuando la extensión haya sido compilada con PHP, o bien sea cargada dinámicamente en ejecución. Además, estas constantes driver-specific deberían ser utilizadas sólo si está usando este driver. Usar atributos driver-specific con otro driver puede resultar en un comportamiento inesperado. PDO::getAttribute() puede ser empleado para obtener el atributo PDO_ATTR_DRIVER_NAME para comprobar el driver, si su código puede correr con múltiples drivers.
Table of Contents
- PDO_FIREBIRD DSN — Connecting to Firebird and Interbase databases
After much trial and error i found out you should use the following to connect to a firebird database:
<?php
$db = new PDO ("firebird:dbname=localhost:C:\\path\\to\\database\\MyDatabase.FDB", "username", "password");
?>
NOTE: in the 1st part of the connection string there can be NO spaces else you will get NULL.
The string provided on this site does not work and will give no error only NULL.
if youre dsn syntax is wrong, see ritsaert's comment, there maybe no errormessage!
The connection string for a firebird PDO connection is different than described above. It is something like:
$DB = new PDO("firebird:dbname=T:\\Klimreg.GDB", "SYSDBA", "masterkey");
after dbname= the default connection string for Interbase and Firebird databases is used as presented to either gds32.dll or fbclient.dll.
