Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people, just like you, are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
Solved

Warning: mysql_result() [function.mysql-result]: Unable to jump to row 0 on MySQL result index 3 in (file path)

Posted on 2008-06-25
3
1,332 Views
Last Modified: 2013-12-12
I just installed Firefox 3, and it automatically entered root as the username in my website's login form and some password (I don't know what it is, since I don't have a password set for my development server).

Just to see what happens, I submit the username and password.  And I receive this error...
Warning: mysql_result() [function.mysql-result]: Unable to jump to row 0 on MySQL result index 3 in (path to my login file)

In IE and firefox 2 it did not automatically populate the form with that username and password.  But, in IE, when I use root as the user name and I copy the password over, I recieve the same error message.

I've attached my corresponding log in file
loginHTML.txt
loginPHP.txt
0
Comment
Question by:jabrthel
  • 2
3 Comments
 

Author Comment

by:jabrthel
ID: 21871443
Well, I just cleared all my private data in firefox 3, so that solved one problem... I guess it was pulling stuff from odd places.  If I place root and that same password, it still gives me a problem.  However, as long as I don't place that password in, it seems to be fine...
0
 

Author Comment

by:jabrthel
ID: 21871460
Well, I just figured out that the password being enter was localhost... so I guess my question would be, why is that particular password giving the above error, when all others are fine?
0
 
LVL 50

Accepted Solution

by:
Steve Bink earned 500 total points
ID: 21920334
I would guess that you are receiving the error not because of the password, but because of the loginID.  Your code to query the database (84-88 in loginPHP.txt):

      mysql_connect("localhost","root","");
      mysql_select_DB("database") or die("unable to select database");
      $query = mysql_query("select * from member where loginID like '$loginID'");
      $passwordSQL = mysql_result($query, 0, "password");
      mysql_close();

If $loginID does not exist in table member, then $query will return with an empty result set.  Since there would be no records, jumping to the first record would fail, presenting the error you are seeing.  You can resolve this by explicitly checking for a single-record result set, taking action if anything looks strange.  You should check that mysql_num_rows($query)==1.  If it does not (no records, or more than one record), then something went wrong.

You can test this theory by using the same user name with any password, as well as trying a real user name with the same password.
0

Featured Post

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Today, still in the boom of Apple, PC's and products, nearly 50% of the computer users use Windows as graphical operating systems. If you are among those users who love windows, but are grappling to keep the system's hard drive optimized, then you s…
These days socially coordinated efforts have turned into a critical requirement for enterprises.
Google currently has a new report that is in beta and coming soon to Webmaster Tool accounts. This Micro Tutorial will highlight new features for Google Webmaster Tools.
This Micro Tutorial will demonstrate how nuggets on the Web are formatted by using Chrome Developer Tools. These tools would not only view the site's CSS but it can also modify it and save the CSS to use on your own site.

829 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question