Date: 09/30/00
- Next message: Todd Cary: "Re: [PHP-DB] Not getting URL data"
- Previous message: Meir kriheli: "Re: [PHP-DB] Array as hidden input"
- In reply to: Todd Cary: "[PHP-DB] Displaying one field"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
On Thu, 28 Sep 2000, Todd Cary wrote:
> In the following script, how would I just display the field, "PH_CD"?
>
> $stmt = 'SELECT * FROM PHOTOS';
> $sth = ibase_query($stmt,$dbh);
> echo("<TABLE border=1>");
> while ($row = ibase_fetch_row($sth)) {
> echo("<TR>");
> foreach($row as $col){
> echo("<TD>" . $col . "</TD>");
> };
> echo("</TR>");
> };
> echo("</TABLE>");
>
> $col->PH_CD does not work.
You can always use ibase_fetch_object which returns the row as a
pseudo-object, and each column as a variable of that object:
while ($row = ibase_fetch_object($sth)) {
echo("<TR><TD>");
echo $row->PH_CD;
echo("</TD></TR>");
};
Note that var names are case sensitive, as write them as the appear in yiur
db.
To use ibase_fetch_row, you should use:
echo $row['PH_CD']
-- Meir Kriheli MKsoft computer systems"There's someone in my head but it's not me" - Pink Floyd
-- PHP Database Mailing List (http://www.php.net/) To unsubscribe, e-mail: php-db-unsubscribe <email protected> For additional commands, e-mail: php-db-help <email protected> To contact the list administrators, e-mail: php-list-admin <email protected>
- Next message: Todd Cary: "Re: [PHP-DB] Not getting URL data"
- Previous message: Meir kriheli: "Re: [PHP-DB] Array as hidden input"
- In reply to: Todd Cary: "[PHP-DB] Displaying one field"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]

