How do I check if a query has returned a value or not because this isn't working? I swear I have done it before but I can't work out why it isn't working.
echo "<form action = 'NoughtsAndCrosses.php' method = 'POST'>
<input type = 'text' name = 'game_search'>
<input type = 'submit' value = 'Search'>
</form>
";
if(isset($_POST["game_search"])) {
$game_search = $_POST["game_search"];
if(!empty($game_search)) {
$query = "SELECT `game_id` FROM `games` WHERE `game_id`='".$game_search."'";
$query_run = mysql_query($query);
$query_result = mysql_result($query_run, 0);
echo $query_result;
if(mysql_num_rows($query_run) != 0) {
echo "Games found";
} else {
echo "No Games Found.";
}
}
}