Dumping fields.....
| From: | Jeff Lewis | Date: | Fri, 27 Jul 2001 19:22:19 +0000 |
| Subject: | Dumping fields..... | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-59994@lists.php.net to get a copy of this message | ||
Using this function to dump a table, having a problem outputting the value
below after the SELECT * FROM $ID.
function dump($ID, $link) {
echo "<font class=\"txt\">Dumped table
<b>$ID</b></font><table
border=\"1\"><tr>";
$fields = mysql_list_fields("hyrum_nuke", $ID, $link);
$columns = mysql_num_fields($fields);
for ($i = 0; $i < $columns; $i++) {
echo "\t<th>". mysql_field_name($fields, $i) . "</th>\n";
}
echo "</tr>";
$query = mysql_query("SELECT * FROM $ID;");
while ($line = mysql_fetch_array($query)) {
while ($value = each($line)){
$value = ereg_replace("<", "<", $value);
$value = ereg_replace(">", ">", $value);
echo "<td valign=\"top\"><pre>$value</pre></td>";
}
}
echo "</table>";
}