Re: Interbase fields by name?
| From: | Lutz Brueckner | Date: | Fri, 20 Oct 2000 10:55:39 +0000 |
| Subject: | Re: Interbase fields by name? | ||
| References: | 1 2 | Groups: | php.db |
| Request: | Send a blank email to php-db+get-3823@lists.php.net to get a copy of this message | ||
Meir kriheli <mksoft@netvision.net.il> wrote:
> Try using ibase_fetch_object. It returns a pseudo-object, with the
> fields as object vars.
>
> e.g (taken from the PHP manual):
>
> <?php
> $dbh = ibase_connect ($host, $username, $password);
> $stmt = 'SELECT * FROM tblname';
> $sth = ibase_query ($dbh, $stmt);
>
> while ($row = ibase_fetch_object ($sth)) {
> print $row->email . "\n";
> }
> ibase_close ($dbh);
> ?>
>
> Pay attention to the case of the vars. For more info see:
Yes, the case of the vars is important. And this is also the
reason, why this example from the manual will not work.
All the property names from the object returned by
ibase_fetch_object() are in capital letters.
So it must be
while ($row = ibase_fetch_object ($sth)) {
print $row->EMAIL . "\n";
}
to get a result.
Lutz
--
ibWebAdmin 0.3alpha *** web-based InterBase database administration
*** download the latest version from http://home.knuut.de/lb/ ***