Posted by Rik on 12/17/72 11:54
monomaniac21 wrote:
> how can i take every field from a table (where there are many) and
> without referencing by name (using a loop) echo there name in a td
> followed by the contents? i think the foreach statement is what im
> looking for? but i dont understand it.
$result = mysql_query'$query);
while($row = mysql_fetch_assoc($result){
echo '<tr>';
foreach($row as $key => $value){
echo "<td>{$key}:{$value}</td>";
}
echo '</tr>';
}
Grtz,
--
Rik Wasmus
Navigation:
[Reply to this message]
|