As fars as i can tell, big_k105 is right.
Quote:
$output = "<table border=1>\n";
if (mysql_num_rows($data) == 0) { // in the case of no results found - display alert message
$output .= "<tr><td colspan=3>No results found</td></tr>";
} else {
forEach ($agencies as $agency) { // display row for each result (eg. you can have more agencies in one town)
$output .= "<tr>";
$output .= "<td>".$agency["date"]."</td>";
$output .= "<td>".$agency["agency"]."</td>";
$output .= "<td>".$agency["city"]."</td>";
$output .= "</tr>\n";
}
}
$output .= "</table>\n";
echo $output;
|
the problem is where you are outputing your data, the only fields that are being outputed are date, agency and city because those are the on;y ones that you are telling it to output. Anyways, here's how i would do it:
echo "<table border=1>";
if (mysql_num_rows($data) <> 0)
{
forEach ($agencies as $agency)
{
echo "<tr>";
echo "<td>{$agency['date']}</td>";
echo "<td>{$agency['agency']}</td>";
echo "<td>{$agency['city']}</td>";
echo "<td>{$agency['day']}</td>";
echo "<td>{$agency['time']}</td>";
echo "<td>{$agency['location']}</td>";
echo "<td>{$agency['building_room']}</td>";
echo "<td>{$agency['street']}</td>";
echo "<td>{$agency['zip']}</td>";
echo "<td>{$agency['phone']}</td>";
echo "<td>{$agency['contact']}</td>";
echo "</tr>";
}
}
else
{
echo "<tr>";
echo "<td>No Results Found!</td>";
echo "</tr>";
}
echo "</table>";
But that's just how i would do it. I find this way a little easyer to read, thus making it easyer to debug. Post any questions that you have and i am sure we can get this problem fixed. Happy Codding!
-Pizentios