mysql_result() problem

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Lozarythmic

    mysql_result() problem

    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.ph p 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_user name = "select username from user_info where id =
    '$last_post_id[$num]'";
    48 $last_post_user name_res = mysql_query($la st_post_usernam e);
    49 $last_poster = mysql_result($l ast_post_userna me_res,0,'usern ame');

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

    Any help appreciated!
  • kingofkolt

    #2
    Re: mysql_result() problem

    "Lozarythmi c" <loz@lemonia.or g> wrote in message
    news:3f584258.0 408171027.2b350 e7f@posting.goo gle.com...[color=blue]
    > 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.ph p 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_user name = "select username from user_info where id =
    > '$last_post_id[$num]'";
    > 48 $last_post_user name_res = mysql_query($la st_post_usernam e);
    > 49 $last_poster = mysql_result($l ast_post_userna me_res,0,'usern ame');
    >
    > please excuse if the code seems a little 'noob'ish, but i'm learning
    > php as i go along.
    >
    > Any help appreciated![/color]

    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


    Comment

    Working...