Use ibase_fetch_row() instead... Then you can use count() on it to see
how many columns there are and loop through them all. 

---John Holmes...

> -----Original Message-----
> From: Saci [mailto:[EMAIL PROTECTED]]
> Sent: Tuesday, July 30, 2002 2:44 PM
> To: [EMAIL PROTECTED]
> Subject: [PHP] $row and alias
> 
> I would like to show some fields based on a Interbase database,
everthing
> is
> working when i type the fields name usinf $row-> field
> 
>  something like this
> 
> while ($row = ibase_fetch_object($sth)) {
>   echo "<TR><TD>$row->RAZAO_SOCI</TD>";
>   echo"<TD>$row->ENDERECO</TD></TR>\n" ;
> }
> 
> But I would like to make a generic output without declaring the field
name
> in code.
> 
> I discover that the code bellow show-me the field names and alias for
any
> feetched database
> 
> while ($row = ibase_fetch_object($sth)) {
>   for ($i=0; $i < $coln; $i++) {
>     $col_info = ibase_field_info($sth, $i);
>     echo "name: ".$col_info['name']." ";
>     echo "alias: ".$col_info['alias']."";
> 
> }
> 
> 
> How can I output the data field content based on field alias  (
> .$col_info['alias'].""; )
> 
> 
> 
> 
> 
> 
> 
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to