$row and alias

From: Date: Tue, 30 Jul 2002 18:43:54 +0000
Subject: $row and alias
Groups: php.general 
Request: Send a blank email to php-general+get-110392@lists.php.net to get a copy of this message
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'].""; )

« previous php.general (#110392) next »