Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
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
Medium Priority
?
1,351 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
[X]
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
  • 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 51

Accepted Solution

by:
Steve Bink earned 2000 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

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

3 proven steps to speed up Magento powered sites. The article focus is on optimizing time to first byte (TTFB), full page caching and configuring server for optimal performance.
There are times when I have encountered the need to decompress a response from a PHP request. This is how it's done, but you must have control of the request and you can set the Accept-Encoding header.
Explain concepts important to validation of email addresses with regular expressions. Applies to most languages/tools that uses regular expressions. Consider email address RFCs: Look at HTML5 form input element (with type=email) regex pattern: T…
The viewer will learn how to look for a specific file type in a local or remote server directory using PHP.
Suggested Courses

604 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