Forum Moderators: coopster
I want a link on that city page that says SHOW ALL. How do I adjust the final page so that it will show all city rows if no city variable is passed in the URL?
SELECT columns FROM tables WHERE statename="$statevar" AND cityname="$pagevar"
Now you could make a script like this:
$query = "SELECT columns FROM tables WHERE TRUE ";
if (!empty($_GET['statevar'])) $query .= "AND state='" . $statevar . '" ';
if (!empty($_GET['cityvar'])) $query .= "AND city='" . $cityvar . '" ';
This way, you normally will only call the full query, but if the page comes with a state or city variable, the query is altered.
Hope it helps. I can be more specific if you give the table information.
--Drogyn