Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 15 of 15
  1. #1
    TrainReq
    Guest

    Unable to jump row 0

    I am getting the following error:
    Warning: mysql_result(): Unable to jump to row 0 on MySQL result index 2 in /home/content/i/n/n/**/html/tracker/connect.php on line 35

    Here is my coding from line 34 on down.


    PHP Code:
        $result mysql_query($sql);
        
    $uid mysql_result($result0"id");
        
    $sql="INSERT INTO hits
        (RID,uid,username,Current,Referrer,Name,Picture,Login,Cookie,Date,logins,email,ip)
        VALUES
        ('NULL','$uid','$HTTP_GET_VARS[g]','$HTTP_GET_VARS[url]','$HTTP_GET_VARS[referrer]','$HTTP_GET_VARS[name]','$HTTP_GET_VARS[pic]','$HTTP_GET_VARS[login]','$HTTP_GET_VARS[cookie]','$date_posted','$HTTP_GET_VARS[logins]','$HTTP_GET_VARS[email]','$_SERVER[REMOTE_ADDR]')"
    ;
        if (!
    mysql_query($sql,$con))
            { 
            die(
    'Error: ' mysql_error());
            }
        
    //This code shows up no matter what, no point in having it.
        //echo "Hello there!";
        
    mysql_close($con); 
    Last edited by TrainReq; 06-04-2007 at 12:09 AM.

  • #2
    UE Antagonizer Fumigator's Avatar
    Join Date
    Dec 2005
    Location
    Utah, USA, Northwestern hemisphere, Earth, Solar System, Milky Way Galaxy, Alpha Quadrant
    Posts
    7,691
    Thanks
    42
    Thanked 637 Times in 625 Posts
    That error most likely indicates your query (the one we can't see) did not return any rows. Use mysql_num_rows() to see if this is indeed the case.

  • #3
    TrainReq
    Guest
    [code]
    INSERT INTO hits
    (RID,uid,username,Current,Referrer,Name,Picture,Login,Cookie,Date,logins,email,ip)
    VALUES
    ('NULL','$uid','$HTTP_GET_VARS[g]','$HTTP_GET_VARS[url]','$HTTP_GET_VARS[referrer]','$HTTP_GET_VARS[name]','$HTTP_GET_VARS[pic]','$HTTP_GET_VARS[login]','$HTTP_GET_VARS[cookie]','$date_posted','$HTTP_GET_VARS[logins]','$HTTP_GET_VARS[email]','$_SERVER[REMOTE_ADDR]')
    [/php]

    That is my query.. i have never messed with mysql_num_rows, i have no idea how to work that.

  • #4
    New Coder
    Join Date
    Sep 2006
    Posts
    92
    Thanks
    4
    Thanked 1 Time in 1 Post
    Quote Originally Posted by TrainReq View Post
    I am getting the following error:
    Warning: mysql_result(): Unable to jump to row 0 on MySQL result index 2 in /home/content/i/n/n/innovator22/html/tracker/connect.php on line 35

    Here is my coding from line 34 on down.


    PHP Code:
        $result mysql_query($sql);
        
    $uid mysql_result($result0"id");
        
    $sql="INSERT INTO hits
        (RID,uid,username,Current,Referrer,Name,Picture,Login,Cookie,Date,logins,email,ip)
        VALUES
        ('NULL','$uid','$HTTP_GET_VARS[g]','$HTTP_GET_VARS[url]','$HTTP_GET_VARS[referrer]','$HTTP_GET_VARS[name]','$HTTP_GET_VARS[pic]','$HTTP_GET_VARS[login]','$HTTP_GET_VARS[cookie]','$date_posted','$HTTP_GET_VARS[logins]','$HTTP_GET_VARS[email]','$_SERVER[REMOTE_ADDR]')"
    ;
        if (!
    mysql_query($sql,$con))
            { 
            die(
    'Error: ' mysql_error());
            }
        
    //This code shows up no matter what, no point in having it.
        //echo "Hello there!";
        
    mysql_close($con); 
    My first question would be what the value of $sql is that you use in line 34 :
    PHP Code:
    $result mysql_query($sql); 
    Is there a specific reason why you would want to use mysql_result() as it is not the best option (for performance reason alone) to use, perhaps something llike mysql_fetch_array() or mysql_fetch_object() might be more suitable.

    Have you tried to execute the $sql statement directly into the database to see if you get a response or if perhaps $sql has an error in it?

  • #5
    TrainReq
    Guest
    the value of $sql is

    Code:
    INSERT INTO hits
        (RID,uid,username,Current,Referrer,Name,Picture,Login,Cookie,Date,logins,email,ip)
        VALUES
        ('NULL','$uid','$HTTP_GET_VARS[g]','$HTTP_GET_VARS[url]','$HTTP_GET_VARS[referrer]','$HTTP_GET_VARS[name]','$HTTP_GET_VARS[pic]','$HTTP_GET_VARS[login]','$HTTP_GET_VARS[cookie]','$date_posted','$HTTP_GET_VARS[logins]','$HTTP_GET_VARS[email]','$_SERVER[REMOTE_ADDR]')

  • #6
    New Coder
    Join Date
    Sep 2006
    Posts
    92
    Thanks
    4
    Thanked 1 Time in 1 Post
    Quote Originally Posted by TrainReq View Post
    [code]
    INSERT INTO hits
    (RID,uid,username,Current,Referrer,Name,Picture,Login,Cookie,Date,logins,email,ip)
    VALUES
    ('NULL','$uid','$HTTP_GET_VARS[g]','$HTTP_GET_VARS[url]','$HTTP_GET_VARS[referrer]','$HTTP_GET_VARS[name]','$HTTP_GET_VARS[pic]','$HTTP_GET_VARS[login]','$HTTP_GET_VARS[cookie]','$date_posted','$HTTP_GET_VARS[logins]','$HTTP_GET_VARS[email]','$_SERVER[REMOTE_ADDR]')
    [/php]

    That is my query.. i have never messed with mysql_num_rows, i have no idea how to work that.
    Just a guess, the value of RID you set to 'NULL', if this is your primary key it is probably auto increment and I would this expect to be '' then instead or leave it out completely.

    Code:
    INSERT INTO hits
    (RID,uid,username,Current,Referrer,Name,Picture,Login,Cookie,Date,logins,email,ip)
    	VALUES
    	('','$uid','$HTTP_GET_VARS[g]','$HTTP_GET_VARS[url]','$HTTP_GET_VARS[referrer]','$HTTP_GET_VARS[name]','$HTTP_GET_VARS[pic]','$HTTP_GET_VARS[login]','$HTTP_GET_VARS[cookie]','$date_posted','$HTTP_GET_VARS[logins]','$HTTP_GET_VARS[email]','$_SERVER[REMOTE_ADDR]')

  • #7
    New Coder
    Join Date
    Sep 2006
    Posts
    92
    Thanks
    4
    Thanked 1 Time in 1 Post
    OK, this might be far fetched... did you define $sql before you executed it in line 34 or is it only defined afterwards in line 36?

  • #8
    TrainReq
    Guest
    i defined on line 36 ... i went
    PHP Code:
    $sql="INSERT INTO hits
        (RID,uid,username,Current,Referrer,Name,Picture,Login,Cookie,Date,logins,email,ip)
        VALUES
        ('','$uid','$HTTP_GET_VARS[g]','$HTTP_GET_VARS[url]','$HTTP_GET_VARS[referrer]','$HTTP_GET_VARS[name]','$HTTP_GET_VARS[pic]','$HTTP_GET_VARS[login]','$HTTP_GET_VARS[cookie]','$date_posted','$HTTP_GET_VARS[logins]','$HTTP_GET_VARS[email]','$_SERVER[REMOTE_ADDR]')"

    on line 36-39

    but still did not fix the prob.

  • #9
    New Coder
    Join Date
    Sep 2006
    Posts
    92
    Thanks
    4
    Thanked 1 Time in 1 Post
    maybe you want to move the definition of $sql 2 lines up before the execution of $result = mysql_query($sql);

  • #10
    TrainReq
    Guest
    Now i am getting a whole new error
    Code:
    Warning: mysql_result(): supplied argument is not a valid MySQL result resource in /home/content/i/n/n/**/html/tracker/connect.php on line 40
    Here is the stuff on line 39 on down
    PHP Code:
    $result mysql_query($sql);
        
    $uid mysql_result($result0"id");
        if (!
    mysql_query($sql,$con))
            { 
            die(
    'Error: ' mysql_error());
            }
        
    //This code shows up no matter what, no point in having it.
        //echo "Hello there!";
        
    mysql_close($con); 

  • #11
    New Coder
    Join Date
    Sep 2006
    Posts
    92
    Thanks
    4
    Thanked 1 Time in 1 Post
    Well, can you at least check on the db if the insert was done so we know that part works?

    also you use "id" in the mysql_result statement and I didnt see this in your insert query. Should this be uid or RID?

  • #12
    TrainReq
    Guest
    the incert was not done, and I am not sure what RID does, but it should be uid if incerting into users table or id if incerting into the hits table

  • #13
    New Coder
    Join Date
    Sep 2006
    Posts
    92
    Thanks
    4
    Thanked 1 Time in 1 Post
    I guess what you need to try and figure out first is why the insert was not done. Can you execute it manually using phpMyAdmin, mysql or something similar?

  • #14
    TrainReq
    Guest
    listen.. if you have AOL instant messanger of yahoo messanger or MSN .. message me your details... i will give you full coding as well as access to the server so you can look more into it.. i will be willing to pay if needed.

  • #15
    TrainReq
    Guest
    can anyone else help me out?


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •