mysql_field_name
| From: | Emiliano Boragina | Date: | Sat, 23 Feb 2008 23:16:34 +0000 |
| Subject: | mysql_field_name | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-269975@lists.php.net to get a copy of this message | ||
Hi list
I have the following code:
<?
$base = "panel";
$conexion = mysql_connect ( 'localhost' , 'root' , 'root' );
mysql_select_db ( $base , $conexion );
echo "<table border='1'>";
$resultado = mysql_query ("select * from registro" , $conexion);
while ( $registro = mysql_fetch_row ($resultado)) {
echo "<tr>";
foreach ( $registro as $clave ) {
echo "<td>" . mysql_field_name($resultado, '')
.
"</td>";
}
echo "</tr>";
echo "<tr>";
foreach ( $registro as $clave ) {
echo "<td>" . $clave . "</td>";
}
}
echo "</tr></table>";
?>
But the result is two TR with only the first field name of the DB.
I want to see all fields name of the DB and only in one TR
how can I do
that (in code please)?
Thanks.
+ _
// Emiliano Boragina _
// Diseño & Comunicación //////////////////
+ _
// emiliano.boragina@gmail.com /
// 15 40 58 60 02 ///////////////////////////
+ _