Hi,
Iīve trying now for hours just to connect with PDO to my firebird DB.
I tried it first with a mysql db and had no problems at all. but it doesnīt work with firebird and I donīt know why (havenīt found anything helpful via google as well).
I tried to use the manual from here: http://de3.php.net/manual/de/function.pdo-construct.php
with the code below, I get always the error message:
Fatal error: Call to a member function getAttribute() on a non-object in K:\_workspace\test1\pdo3.php on line 7
a test with the interbase driver works well (see in the code comments).
=> is the code correct? => where is the error!? => does the PDO firebird driver work?
thx a lot for help,
Michael
<?php $username = 'SYSDBA'; $password = 'xxxxxx';
$dbh = new PDO( 'firebird:User=SYSDBA;Password=xxxxxx;Database=k:\_firebird\examples\EMPLOYEE.FDB;DataSource=localhost;Port=3050', $username, $password );
//$dbh = new PDO( 'firebird:User=SYSDBA;Password=xxxxxx;Database=k:\_firebird\examples\EMPLOYEE.FDB;DataSource=localhost;Port=3050' );
print $dbh->getAttribute(PDO_ATTR_AUTOCOMMIT); // <==Fatal error here!
$stmt = $dbh->prepare("Select * from SHOW_LANGS('SRep',4,'Italy')");
$stmt->execute();
$stmt = null;
/*
// test with ibase driver
$dsn = 'localhost:k:\_firebird\examples\employee.fdb';
$dbh = ibase_connect ( $dsn, $username, $password ) or die ("error in db connect");
$stmt="Select * from SHOW_LANGS('SRep',4,'Italy')";
$query = ibase_prepare($stmt);
$rs=ibase_execute($query);
$row = ibase_fetch_row($rs);
echo $row[0];
// free result
ibase_free_query($query);
//ibase_free_result($rs);
// close db
ibase_close($dbh);
*/
?>
-- PHP Internals - PHP Runtime Development Mailing List To unsubscribe, visit: http://www.php.net/unsub.php