/ Published in: PHP
Not mine. Changed from the original it to suit my needs.
Expand |
Embed | Plain Text
Copy this code and paste it in your HTML
function _mysql_result_all($result, $tableFeatures="border='1'",$nodata=" ") { $tableDebug .= "<!--Debugging output for SQL query-->\n\n"; echo "<table $tableFeatures>\n\n"; echo "<tr>\n"; for ($i = 0; $i < $noFields; $i++) { echo "\t<th>$field</th>\n"; } echo "<tr>\n"; foreach ($r as $column) { echo "\t<td>"; if ($column == NULL) { echo "$nodata"; } else { echo $column; } echo "</td>\n"; } echo "</tr>\n"; } echo "</table>\n\n"; echo "<!--End debug from SQL query-->\n\n"; return $tableDebug; } _mysql_result_all($result);
URL: http://www.thescripts.com/forum/thread276.html