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?

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.

 

Archived

This topic is now archived and is closed to further replies.

×
×
  • 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.