MikeDXUNL Posted June 18, 2008 Share Posted June 18, 2008 Alright, my database has entries with ID's 1, 2, 4 only those 3 are in the database when I go to try and see if the game is in the DB <?php $result = mysql_query("SELECT * FROM videogames WHERE gameid = '$gameid'") or die ("Error: ".mysql_error()); $countResult = count($result); echo $countResult; ?> if echo's out 1 no matter what the number is (ie. 5, 32, 500) when those ID's don't exsist. any help? Quote Link to comment https://forums.phpfreaks.com/topic/110776-solved-countresult-help/ Share on other sites More sharing options...
Jabop Posted June 18, 2008 Share Posted June 18, 2008 Your result is true, you're not using the proper count. <?php $countResult=mysqli_num_rows(mysqli_query($result)); echo $countResult; ?> Quote Link to comment https://forums.phpfreaks.com/topic/110776-solved-countresult-help/#findComment-568312 Share on other sites More sharing options...
MikeDXUNL Posted June 18, 2008 Author Share Posted June 18, 2008 gah! can't believe I didn't catch that myself. thank you! Quote Link to comment https://forums.phpfreaks.com/topic/110776-solved-countresult-help/#findComment-568317 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.