downloads | documentation | faq | getting help | mailing lists | licenses | wiki | reporting bugs | php.net sites | links | conferences | my php.net

search for in the

PDO_FIREBIRD DSN> <PDO_DBLIB DSN
[edit] Last updated: Fri, 10 Feb 2012

view this page in

Firebird/Interbase 関数 (PDO_FIREBIRD)

導入

警告

この拡張モジュールは、 実験的 なものです。この拡張モジュールの動作・ 関数名・その他ドキュメントに書かれている事項は、予告なく、将来的な PHP のリリースにおいて変更される可能性があります。 このモジュールは自己責任で使用してください。

PDO_FIREBIRD は、PHP から Firebird および Interbase データベースへのアクセスを可能にするための PHP Data Objects (PDO) インターフェース を実装したドライバです。

インストール手順

--with-pdo-firebird[=DIR] で PDO Firebird 拡張モジュールをインストールします。オプションの [=DIR] には、Firebird の基底インストールディレクトリを指定することができます。

$ ./configure --with-pdo-firebird

定義済み定数

このドライバでは以下の定数が定義されて います。これは拡張モジュールが PHP に組み込まれているか、実行時に動的にロード されている場合のみ使用可能です。さらに、これらのドライバ固有の定数は そのドライバを使用している場合にのみ使用されます。 あるドライバ固有の属性を別のドライバで使うと、予期せぬ結果を引き起こします。 もし複数のドライバを使用しているコードを実行している場合、 PDO::getAttribute()PDO_ATTR_DRIVER_NAME 属性を使用することで、使用中のドライバ名を調べることが可能です。

PDO::FB_ATTR_DATE_FORMAT (integer)

PHP 5.3.0 以降で使用可能。

日付フォーマットを設定します。

PDO::FB_ATTR_TIME_FORMAT (integer)

時刻フォーマットを設定します。

PHP 5.3.0 以降で使用可能。

PDO::FB_ATTR_TIMESTAMP_FORMAT (integer)

タイムスタンプフォーマットを設定します。

PHP 5.3.0 以降で使用可能。

目次

  • PDO_FIREBIRD DSN — Firebird および Interbase データベースに接続する


PDO_FIREBIRD DSN> <PDO_DBLIB DSN
[edit] Last updated: Fri, 10 Feb 2012
 
add a note add a note User Contributed Notes Firebird/Interbase (PDO)
confik at gmail dot com 14-Sep-2011 01:01
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 03-Jun-2007 03:15
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 08-Mar-2006 05:18
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 04-Feb-2006 05:52
if youre dsn syntax is wrong, see ritsaert's comment, there maybe no errormessage!
ritsaert at continuit dot nl 18-Dec-2005 06:43
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.

 
show source | credits | stats | sitemap | contact | advertising | mirror sites