Forum » » Le coin des codeurs » » [Résolu] - Champ inconnu
Posté : 8 mars 2007 à 19:19
<?php
$query = mysql_query("SELECT * FROM table");
$row = mysql_fetch_assoc($query));
echo '<table><tr>';
foreach($row as $nom=>$col) echo '<th>'.$nom.'</th>';
echo '</tr><tr>';
foreach($row as $col) echo '<td>'.$nom.'</td>';
echo '</tr>';
while($row = mysql_fetch_assoc($query)) {
echo '<tr>';
foreach($row as $col) echo '<td>'.$col.'</td>';
echo '</tr>';
}
echo '</table>';
?>
Cet article provient de NPDS
https://www.npds.org/viewtopic.php?topic=22053&forum=5