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.";
        }

    }
}

I might be wrong, but I think your SQL Where clause should not test for game_id but rather for game_name or something similar no?

I agree with perlexed, it looks as though you're asking for a game_id when... well when you already have one?

SELECT `game_id` FROM `games` WHERE `game_id`=

I personally would use the SQL like function, because if the users search term doesn't match your predefined name EXACTLY, you'll get no results.

The MySQL LIKE operator will return results with a similar value to the submitted search term.

I see what you guys mean, that is probably it... thanks :)