You're basically asking how to access Parameters that were sent via GET-Method. All these Parameters can be accessed via the associative $_GET-Array in PHP.
So if location=india and you do
echo $_GET['location'];
that would output
india
When creating SQL-Queries from these variables keep in mind that the user could manipulate the URL and insert harmful values in your code (so called SQL-Injection). Always mask such data with the mysql_real_escape_string function in PHP.