0) {
echo "
";
$line = mysql_fetch_array($result, MYSQL_ASSOC);
echo "\n";
echo "\t# | \n";
//outputs the column headers, headers are the names of the fields in the databasae
foreach (array_keys($line) as $col_value) {
echo "\t$col_value | \n";
}
echo "\t
\n";
$i=0;
do {
echo "\n";
$i++;
echo "\t$i | \n";
$j=0;
foreach ($line as $col_value) {
//outputs the first six columns
if($j != "7") {
echo "\t$col_value | \n";
$j++;
}
//outputs the last column which is the picture
else {
echo ' | ';
}
}
echo "
\n";
} while ($line = mysql_fetch_array($result, MYSQL_ASSOC));
echo "
\n";
}
else {
//if query returns no rows then there are no records for that location
echo "
";
echo "There are no records for this location.";
}
mysql_free_result($result);
mysql_close($link);
?>