Suppose I have this table:
id | name | city
------------------
1 | n1 | c1
2 | n2 | c2
3 | n3 | c3
4 | n4 | c4
I want to check
"SELECT * FROM yourTable WHERE city = 'c7'"
"SELECT * FROM yourTable WHERE city LIKE '%c7%'"
Of course you can change '%c7%' to '%c7' or 'c7%' depending on how you want to search it. For exact match, use first query example.
$result = mysql_query("SELECT * FROM yourTable WHERE city = 'c7'");
$matchFound = mysql_num_rows($result) > 0 ? 'yes' : 'no';
echo $matchFound;
You can also use if condition there.