In my database I have user: 1234 with highscore: 222
So I was thinking of getting his data like this (I only have to check for 1 user and I need just the highscore as result it exists):
$highscore =
mysql_query("SELECT highscore FROM mydatabase WHERE userID = 1234");
Now it can happen that this user is deleted, so I want to do a check using num_rows. If the user doesn't exists anymore, set $highscore = 1;
(cause we need this variable somewhere else):
if (mysql_num_rows($highscore) == 0) {
$highscore = 1;
}
And now echo the result like:
echo '<div id="uhs">'. $highscore .'</div>';
The result is however: Resource id #10
Did some research of course and I think the problem lies in my first query, but I can't seem to fix it...
How to get the 222 echoed?