i am having trouble "switching" to the correct sql statement. Case 1 and 2 work correctly when a country 1 or 2 is selected. When no country is selected but the user submits, I am not getting a result. All listings have a $id denoting country. I want the default to be all listings.
$id = "country";
switch($id)
{
case "1" : $result = mysql_query("SELECT * FROM table WHERE method = '$method' AND country = '1'");
break;
case "2" : $result = mysql_query("SELECT * FROM table WHERE method = '$method' AND country = '2'");
break;
default: $result = mysql_query("SELECT * FROM table WHERE method = '$method'");
}
Did I miss the obvious?
Thanks so much.