Subject Re: PDO connection problems
Author chreos3
--- In, Lester Caine <lester@...> wrote:
> Robert martin wrote:
> > Hi
> >
> > I am new to this group so excuse me if it has been covered many times (I
> > did a search but cant find much).
> >
> > I have some PHP scripts that uses PDO as the database connection
> > method. I used PDO because of its multi database connection system. It
> > is working great at a number of sites using MYSQL but I am now trying to
> > use it with Firebird.
> Take care - PDO is ONLY connection compatible with different databases
> which is why many of us are still using the alternative libraries that
> also handle data mapping and SQL mapping.

Ok. What I am doing is pretty basic but will keep an eye on it :)

> > I have setup IIS and installed PHP / PDO / Firebird extension (PHP
> > 5.3). PhpInfo shows everything is running. In my scripts I should be
> > able to change the connection string and it should be done, however my
> > connection string just wont work.
> But 5.3 does not have the Firebird stuff included yet - where are you
> getting the pdo_firebird extension from?

I lie !

I am using 5.2.9-2 according to phpInfo. It came pre-compiled in the zip.

> > my connection script is as follows
> >
> > $dbh = new
> > PDO("firebird:dbname=localhost:C:\\ReportDB\\reports.fdb", "SYSDBA",
> > "masterkey");
> Not using PDO at all myself, I'd probably suggest setting up an alias
> for the database and loosing the path details, but all the other drivers
> seem to need 'driver:host=hostname;dbname=DbName' which I presume is
> what you are using with MySQL?

Yes thats what I use with MYSQL. I used the above becuase its what is shown with all FB samples and similar to what my Delphi components use for connections.

Just tried

$dbh = new PDO("firebird:host=localhost;dbname=C:\\Reports.fdb", "SYSDBA", "masterkey"); //Live DB

and no go either. Same error message.

> > With this I get a 'HTTP/1.1 500 Internal Server Error'. I have tried it
> > without the double slashes and it no longer fails but returns NULL.
> > Actually I have tried just about everything I can think of and no go !!
> >
> > Any help would be greatly appreciated :)
> php_interbase is a little more cooperative on error messages and you
> will find a version of the extension for 5.3 in the files section

I am away tomorrow but might give the interbase one a go on Wednesday.