PDO 驱动
在线手册:中文  英文

Firebird/Interbase Functions (PDO_FIREBIRD)

简介

PDO_FIREBIRD is a driver that implements the PHP Data Objects (PDO) interface to enable access from PHP to Firebird and Interbase databases.

安装

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

预定义常量

下列常量由此驱动定义,且仅在扩展编译入 PHP 或在运行时动态载入时可用。另外,使用此驱动时,仅会使用这些驱动特定的常量。使用其他驱动的驱动特定的常量可能会导致不可预见的情况。如果代码可运行于多个驱动, PDO::getAttribute() 可被用于获取 PDO_ATTR_DRIVER_NAME 属性以检查驱动。

PDO::FB_ATTR_DATE_FORMAT (integer)

Available since PHP 5.3.0.

Sets the date format.

PDO::FB_ATTR_TIME_FORMAT (integer)

Sets the time format.

Available since PHP 5.3.0.

PDO::FB_ATTR_TIMESTAMP_FORMAT (integer)

Sets the timestamp format.

Available since PHP 5.3.0.

Table of Contents


PDO 驱动
在线手册:中文  英文

用户评论:

Anonymous (2012-10-01 12:40:17)

After two days of trouble with no visibile issues, when rebooting the system two popups come up:

PHP Startup: Unable to load dynamic library
'c:/wamp/bin/php/php.5.3.13/ext/php_interbase.dll' - %1 non è un'applicazione di Win32 valida.

PHP Startup: Unable to load dynamic library
'c:/wamp/bin/php/php.5.3.13/ext/php_pdo_firebird.dll' - %1 non è un'applicazione di Win32 valida.

I've just re-installed wampserver (http://www.wampserver.com/en/) and all seems run well.

To see if your Firebird PDO driver runs well:

<?php 
 
foreach(PDO::getAvailableDrivers() as $driver) {
  echo 
$driver.'<br />';
}
?>

confik at gmail dot com (2011-09-14 01:01:21)

Here's the quick guide how to compile pdo_firebird and run tests for the ubuntu:
1) setup firebird superclassic:
$ sudo apt-get install firebird2.5-superclassic firebird2.5-dev
firebird2.5-examples
superclassic is the server itself (if in doubt, read this: http://www.firebirdsql.org/file/documentation/reference_manuals/user_manuals/html/qsg25-classic-or-super.html), dev package contains headers to
compile pdo stuff, examples contains example db, i used it to run
tests in it.
Set up credentials for the server (see the link lower).
Get employee.fdb as written here
http://www.firebirdsql.org/manual/ubusetup.html to a some known and
writable path by your user (which tests will be run on).
2) make sure to compile php with following flags, you'll need interbase too (some
tests in pdo_firebird/tests need it)
./configure --enable-pdo --with-pdo-firebird --with-interbase
make
3) Run tests with environment variables that can be found in
ext/pdo_firebird/tests/common.phpt, I ran it like this:
$ PDO_FIREBIRD_TEST_DSN='firebird:dbname=/var/lib/firebird/2.5/data/employee.fdb'
PDO_FIREBIRD_TEST_USER='SYSDBA' PDO_FIREBIRD_TEST_PASS='masterkey'
TEST_PHP_EXECUTABLE=auto php -n ./run-tests.php ext/pdo_firebird
You're done!

mark-php at vectrex dot org dot uk (2007-06-03 03:15:54)

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

Darren (2006-03-08 05:18:36)

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.

thomas at last-it dot de (2006-02-04 05:52:51)

if youre dsn syntax is wrong, see ritsaert's comment, there maybe no errormessage!

ritsaert at continuit dot nl (2005-12-18 18:43:24)

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.

易百教程