Hello
From a form, I want to use a variable $city to search through a table called stores and output all those with matching criteria or return a message saying nothing meeting the search criteria was found.
I have used these forums to get to where I am at (they have been extremely helpful) but now I am at a loss. In testing, I only get the Invalid Query message and for the life of me, I can't seem to see what is wrong with the query.
<?
$connection = mysql_connect('localhost', 'user', 'password');
$db = mysql_select_db('database');
//query
if ( "city" == $city ) {
$sql = mysql_query("SELECT * FROM stores WHERE city = '$city' ORDER BY 'ranking' DESC");
} else {
die("Invalid Query");
}
$result=mysql_query($sql, $connection);
//initialize arrays
blah, blah, blah
Any help would really be appreciated.
Bob