Subject Re: Problems about PHP connect Firebird
Author Tommy Cheng
--- In firebird-php@yahoogroups.com, Lester Caine <lester@...> wrote:
>
> Tommy Cheng wrote:
> > --- In firebird-php@yahoogroups.com, Lester Caine <lester@> wrote:
> >> Tommy Cheng wrote:
> >>> I have a ERP software developed by Clarion and use Firebird as
> >>> database, it runs as Server / Client mode.
> >>> Now i would like to have a Web version use PHP / Firebird.
> >>>
> >>> I am using the following :
> >>>
> >>> OS : Windows XP
> >>> Server : Apache 2.2
> >>> PHP : 5+
> >>> Database : Firebird 2.0
> >>>
> >>> However, i try the ODBC connect and PDO connect also failed ..
> >>>
> >>> Any solution for me ?
> >> ODBC would need one of the Firebird ODBC drivers installed - not
> > used it for a
> >> long time now so I don't know the state of play there.
> >> The PDO Firebird driver has not had much attention since the
native
> >> Interbase/Firebird driver is much more capable.
> >> Not sure if Clarion understands the native database drivers in
PHP,
> > but that
> >> is the cleanest way to access data ( In my opinion ;) )
> >
> > Dear Sir,
> Lester - please - I have not been knighted yet ;)
>
> > I use Firebird ODBC to connect FB database with Clarion, and it
runs
> > pretty good ..
> If you have ODBC working then, the ODBC driver for PHP should pick
it up. I
> have used it in the past but some time ago. What is the error that
it's
> showing? This is where multiple support lists are fun. There is a
list for
> ODBC as well as PHP so the problem may already be known to the ODBC
people but
> not us PHP only mortals :)
>
> >>From your opinion above, would you mind give me more details ?
> Only that adding extra layers does not seem the most efficient way
to work.
> ODBC is just another layer between PHP and Firebird, while the
native driver
> works direct into Firebird. Having said that I run the PHP
abstraction layer
> ADOdb in between anyway. ADOdb will talk via ODBC as well as direct.
>
> --
> Lester Caine - G8HFL
> -----------------------------
> Contact - http://home.lsces.co.uk/lsces/wiki/?page=contact
> L.S.Caine Electronic Services - http://home.lsces.co.uk
> MEDW - http://home.lsces.co.uk/ModelEngineersDigitalWorkshop/
> Firebird - http://www.firebirdsql.org/index.php
>
I used the following PHP to connect but i can't :

<?php
$host = 'localhost:C:\AppServ\Firebird\Data.FDB';
$username = 'SYSDBA'
$password = 'masterkey'
$dbh = ibase_connect($host, $username, $password);
$stmt = 'SELECT * FROM CUSTOMER';
$sth = ibase_query($dbh, $stmt);
while ($row = ibase_fetch_object($sth)) {
echo $row->email, "\n";
}
ibase_free_result($sth);
ibase_close($dbh);
?>

something wrong ?