DrFishNips Posted July 2, 2009 Share Posted July 2, 2009 I'm getting this error when I use this query SELECT * FROM potg_articles WHERE uploader='$member' ORDER BY id it says Warning: mysql_result() [function.mysql-result]: Unable to jump to row 0 on MySQL result index 28 in /var/www/potg/members/articles.php on line 59 Warning: mysql_result() [function.mysql-result]: Unable to jump to row 0 on MySQL result index 28 in /var/www/potg/members/articles.php on line 60 Warning: mysql_result() [function.mysql-result]: Unable to jump to row 0 on MySQL result index 28 in /var/www/potg/members/articles.php on line 61 Warning: mysql_result() [function.mysql-result]: Unable to jump to row 0 on MySQL result index 28 in /var/www/potg/members/articles.php on line 62 when I echo $num it says 1 but there are no entries in the DB that match the query. Any ideas what might be wrong? Quote Link to comment Share on other sites More sharing options...
PFMaBiSmAd Posted July 2, 2009 Share Posted July 2, 2009 Cannot really help you without seeing the code from the query to and including the code generating the errors. Quote Link to comment Share on other sites More sharing options...
DrFishNips Posted July 2, 2009 Author Share Posted July 2, 2009 Sorry heres the PHP http://pastebin.com/mdbf6e98 If there is 1 entry mysql_num_rows says its 1 and if there are 2 it says its 2 etc. the problem only emerges when there are no rows. It says there is 1 for some reason. Quote Link to comment Share on other sites More sharing options...
PFMaBiSmAd Posted July 2, 2009 Share Posted July 2, 2009 Both of the following lines of code are assigning a value to $num, not testing if $num is equal to the value - elseif ($num = 1) { echo "You have uploaded <b>$num</b> article.\n\n"; } elseif ($num = 0) { echo "You have not uploaded any article.\n\n"; } Two == signs is an equal comparison, one = sign is an assignment operator. Quote Link to comment Share on other sites More sharing options...
DrFishNips Posted July 2, 2009 Author Share Posted July 2, 2009 Ah right. I was actually gonna look up the difference between 1 and 2 = signs today. Thanks a lot. Quote Link to comment 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.