Jump to content

[SOLVED] Mysql num rows telling me there is 1 row when there are none


DrFishNips

Recommended Posts

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?

Link to comment
Share on other sites

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.

 

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.