PHP + ADOdb + Firebird

Here we go…

First download the latest PHP ADOdb library here: ADOdb Library for PHP.

Install it in proper directories and make sure your Firebird server is running.

- Setup your PHP to support Firebird functions

Edit your php.ini and do this:

  • setup YOUR extension_dir
    extension_dir = “D:\PHP5\ext”
  • Remove the ; of the interbase library
    ;extension=php_ifx.dll
    ;extension=php_imap.dll
    extension=php_interbase.dll
    ;extension=php_ldap.dll
    ;extension=php_mcrypt.dll
    ;extension=php_mhash.dll
  • restart your apache or IIS or whatever

- Setup the database info
<?php
define("DBUSER", "sysdba");
define("DBPASS", "foopassword");
define("DBHOST", 'localhost:C:/your/path/to/the/database.gdb');
?>

!POSSIBLE PROBLEM!: in the host parameter, localhost must be the IP address or hostname of the server where is running the Firebird server.

- Setup the ADOdb
<?php
include("adodb/adodb.inc.php");
// VERY IMPORTANT due Firebird do not send the column names as default
$ADODB_FETCH_MODE = ADODB_FETCH_ASSOC;
$DB = &ADONewConnection(’firebird’);
$DB->Connect(DBHOST, DBUSER, DBPASS);
?>

- Testing
<?php
$SQL = "SELECT * FROM TABLENAME ORDER BY DAMNFIREBIRD";
$res = $DB->Execute($SQL);
if ($res->RecordCount() != 0) {
  while(!$res->EOF) {
    echo $res->fields['DAMNFIREBIRD'];
    $res->MoveNext();
  }
}
?>

5° - this shit is working =)

One Response to “ PHP + ADOdb + Firebird ”

  1. RODNEY Says:


    Medicamentspot.com. Canadian Health&Care.Special Internet Prices.No prescription online pharmacy.Best quality drugs. Low price drugs. Buy drugs online

    Buy:Maxaman.Cialis Professional.Viagra.Super Active ED Pack.Viagra Super Force.Viagra Super Active+.Cialis.Viagra Soft Tabs.Tramadol.Viagra Professional.Levitra.Soma.Zithromax.Propecia.Cialis Super Active+.VPXL.Cialis Soft Tabs….

Leave a Reply