How to fix mysql_result error that occurs only when using Google Chrome

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • KeredDrahcir
    Contributor
    • Nov 2009
    • 426

    #1

    How to fix mysql_result error that occurs only when using Google Chrome

    Can anyone help me. I don't know if this is a mysql, php or Google Chrome error.
    I have a login form but for some reason I'm getting an error when I use Google Chrome. It used to work in all browsers (IE, Firefox, Safari, Opera, Google Chrome) but for some reason it has stopped working and Google Chrome. I assume it has something to do with me upgrading to Windows 7.

    The error is this:
    Warning: mysql_result(): Unable to jump to row 0 on MySQL result index 30 in /server path/file.php on line 26

    The code around this is as follows (line 26 is the second line):
    Code:
      $result = mysql_query("SELECT [I]variable[/I] FROM [I]table[/I] WHERE [I]field[/I]='[I]value[/I]'");
      $_SESSION['[I]name[/I]']=mysql_result($result, 0);
    Is there something I'm doing wrong. I've had problems with Google Chrome before that I had to fix.
  • KeredDrahcir
    Contributor
    • Nov 2009
    • 426

    #2
    I think the problem is quite different. The code isn't supposed to reach line 26 and therefore it is trying to perform the queary with values it doesn't have.

    The code is supposed to do this:
    Code:
        echo "<script langauge='javascript'>location.href='[I]new folder[/I]/index.php';</script>";
    I;ve had problems with Script tags in Google Chrome before. Is there anyway I can get them to work.

    Comment

    • KeredDrahcir
      Contributor
      • Nov 2009
      • 426

      #3
      If I put and exit(); command in it works. Can anyone suggest why?

      Comment

      • KeredDrahcir
        Contributor
        • Nov 2009
        • 426

        #4
        I think in Chrome it ties to run the whole page and then do the Javascript and so it runs my page, decides to come back to the Javascript later and continues running the page where the Javascript would have directed it somewhere else.

        Is this a possibility? If anyone can help I may be able to work around this. If this is true maybe someone should file a bug with Google.

        Comment

        Working...