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.
1° - 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
2° - 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.
3° - 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);
?>
4° - 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 =)
July 21st, 20104:08 am at
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….