Subject Re: [firebird-php] PDO extension
Author marius adrian popa
On Mon, May 23, 2011 at 6:36 PM, John & Carole <fuentelucas@...> wrote:
> I've attempted to load the above (for a firebird2.1 & PHP5.3.2
> combination running on ubuntu 10.04), but I'm unable to peraude it to
> work. While the following code opens the database:
>
> $str_conn="firebird:dbname=localhost:/var/lib/firebird/2.1/data/cricket.fdb";
> $dbh = ibase_connect($str_conn, "firebird", "******", "UTF8");
>
> this does not:
>
> $dbh = new PDO($str_conn, "firebird", "******", "UTF8");

Something is wrong with connection string here is the proper way


$str_conn="firebird:host=localhost;dbname=/var/lib/firebird/2.5/data/employee.fdb;charset=UTF8";
$connection = new PDO($str_conn, "sysdba", "masterkey");
$sql = 'select count(*) from employee';
$count = $connection->query($sql);
print_r ($count->fetch());

https://gist.github.com/987151