Hi,
I quickly looked at your result page and it does not make sense to me. I will ignore the top part and below is my UNTESTED version that you may try...
Code:
$data = @mysql_query("SELECT * FROM agencies WHERE action = $value");
if (!data){echo("
Error: " . mysql_error() ."</p>"); exit();}
while ( $agency = mysql_fetch_array($data) )
{
$num_rows = mysql_num_rows($agency);//count records
if ($num_rows == 0)
{
echo "No result here";
}
else
{
$output = "<table border=1>\n";
$output .= "<tr>";
$output .= "<td>".$agency["date"]."</td>";
$output .= "<td>".$agency["agency"]."</td>";
$output .= "<td>".$agency["city"]."</td>";
$output .= "<td>".$agency["day"]."</td>";
$output .= "<td>".$agency["time"]."</td>";
$output .= "<td>".$agency["location"]."</td>";
$output .= "<td>".$agency["building_room"]."</td>";
$output .= "<td>".$agency["street"]."</td>";
$output .= "<td>".$agency["zip"]."</td>";
$output .= "<td>".$agency["phone"]."</td>";
$output .= "<td>".$agency["contact"]."</td></tr>\n";
$output .= "</table>";
echo "$output";
}
}
I am trying to understand what are you trying to do. The drop down list you have would allow you to display 3 different set of results..
if action is date, the database would display...
if action is agency, the database would display..
if action is city, the database would display...
As far as I know, they all would display the same result because you are pulling the same information from the database. For example, the database query above says..
SELECT * FROM agencies WHERE action = $value
Which means
SELECT EVERYTHING FROM AGENCIES WHERE ACTION EQUAL DATE
SELECT EVERYTHING FROM AGENCIES WHERE ACTION EQUAL AGENCY
SELECT EVERYTHING FROM AGENCIES WHERE ACTION EQUAL CITY
Give it a try and let me know how it works out.
thanks