note 40769 deleted from function.mysql-fetch-array by philip
| From: | philip@php.net | Date: | Sun, 08 Aug 2004 16:43:44 +0000 |
| Subject: | note 40769 deleted from function.mysql-fetch-array by philip | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-74245@lists.php.net to get a copy of this message | ||
Note Submitter: sales@historicfuture.com
----
This snip is a variation on one above with neater out put.
<table style="width: 100%; text-align: left;" border="1"
cellpadding="2"
cellspacing="0">
<?
$fields = mysql_query("select * from table");
$row=mysql_fetch_array($fields, MYSQL_ASSOC);
echo "<tr>";
while(list($key,$val) = each($row) ) {
echo "<td>$key</d>";
}
echo "</tr>";
while($row=mysql_fetch_array($fields, MYSQL_ASSOC)) {
echo "<tr>";
while(list($key,$val) = each($row) ) {
echo "<td> $val</d>";
}
echo "</tr>";
}
mysql_free_result($fields);
?>
</table>