Subject | Re: [firebird-support] ibase_query question |
---|---|
Author | Helen Borrie |
Post date | 2007-10-05T13:15:17Z |
At 10:56 PM 5/10/2007, you wrote:
directed you to the firebird-php list earlier today...
On the firebird-support front, it looks as if you defined the table
with quoted identifiers, e.g.
create table "entries" ( ...)
If you define table identifiers this way, they are case-sensitive and
must be quoted and case-correct wherever you refer to them. It is
conformant with the SQL standard to make this an option but it is not
obligatory and, for most people, it is worth avoiding.
(Some tools double-quote everything by default and have to be
configured to NOT double-quote...not a good feature, IMO. Tools that
default to not double-quoting are a lot more sympathetic with the way
people actually work.)
If you had done
create table entries (...) the identifier would have been stored as
ENTRIES and your references could then be case-insensitive, i.e.,
select * from entries
would be the same as
select * from ENTRIES
and not the same as
select * from "entries"
^ heLen
>In order to learn how to use PHP (5.2.4) with Firebird, I have createdPHP questions are off-topic for this list. I think someone already
>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?
directed you to the firebird-php list earlier today...
On the firebird-support front, it looks as if you defined the table
with quoted identifiers, e.g.
create table "entries" ( ...)
If you define table identifiers this way, they are case-sensitive and
must be quoted and case-correct wherever you refer to them. It is
conformant with the SQL standard to make this an option but it is not
obligatory and, for most people, it is worth avoiding.
(Some tools double-quote everything by default and have to be
configured to NOT double-quote...not a good feature, IMO. Tools that
default to not double-quoting are a lot more sympathetic with the way
people actually work.)
If you had done
create table entries (...) the identifier would have been stored as
ENTRIES and your references could then be case-insensitive, i.e.,
select * from entries
would be the same as
select * from ENTRIES
and not the same as
select * from "entries"
^ heLen