mysql_result() problem

Do you have a question? Post it now! No Registration Necessary.  Now with pictures!

Threaded View
Hello all,

I'm having a slight problem with a script i created at work. All was
fine until one day i decided i'd work on it at home, so i set up the
same apache server (2.0.49) and php (4.3.3) and mysql (4.0.15) and now
one of my scripts returns this:

Warning: mysql_result(): Unable to jump to row 0 on MySQL result index
24 in F:\web\forum.php on line 49

The only major difference between the two computers is that office one
runs windows 98, and my home pc runs XP Pro. The code on the two
machines is EXACTLY the same.

The code involved:

47        $last_post_username = "select username from user_info where id =
48        $last_post_username_res = mysql_query($last_post_username);
49        $last_poster = mysql_result($last_post_username_res,0,'username');

please excuse if the code seems a little 'noob'ish, but i'm learning
php as i go along.

Any help appreciated!

Re: mysql_result() problem

Quoted text here. Click to load it

Generally this means there are no records in the user_info table with that
particular ID. Maybe try checking it with mysql_num_rows(). When you
transferred everything from your work computer to your home computer, did
you copy your mysql data folder also?

- JP

Site Timeline