Subject Re: [firebird-support] ibase_query question
Author Lester Caine
ke4dm wrote:
> In order to learn how to use PHP (5.2.4) with Firebird, I have created
> a table "entries" with four fields "id,title,content,date" in a
> database blognew.fdb. I have entered four rows of data into the table.
> Using Lester's tutorial as a guide, I wrote the following PHP script:
>
> <?php
> $dbh = ibase_connect('localhost:/opt/fbdata/blognew.fdb', 'webuser',
> 'webuser');
> if (!$dbh)
> {
> echo "Error while connecting: ".ibase_errmsg();
> exit();
> }
> $sth = ibase_query($dbh, "select * from entries");
> while ($row = ibase_fetch_object($sth)) {
> echo "$row->CONTENT";
> }
> ibase_close ($dbh);
> ?>
>
> The connection apparently works, but the query fails with an error
> code -204 "Table unknown ENTRIES". Any ideas on what I am doing wrong?

Check the 'case' ;)
If you have created "entries" you will need the double quotes in the query!
But it makes more sense to create ENTRIES so that we do not have to manage
extra double quotes in PHP.

You will find the PHP users on http://groups.yahoo.com/group/firebird-php/

--
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