Date: 07/30/02
- Next message: Martin Towell: "RE: [PHP] passing variable via url ( newbye question)"
- Previous message: Evgeny Chuykov: "[PHP] Re: searching an array for words starting with 'p'"
- In reply to: Saci: "[PHP] $row and alias"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
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:nospam <email protected>]
> Sent: Tuesday, July 30, 2002 2:44 PM
> To: php-general <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
- Next message: Martin Towell: "RE: [PHP] passing variable via url ( newbye question)"
- Previous message: Evgeny Chuykov: "[PHP] Re: searching an array for words starting with 'p'"
- In reply to: Saci: "[PHP] $row and alias"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]

