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,316 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

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

Suggested Solutions

Citrix XenApp, Internet Explorer 11 set to Enterprise Mode and using central hosted sites.xml file.
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…
The viewer will learn how to dynamically set the form action using jQuery.
The viewer will learn how to create and use a small PHP class to apply a watermark to an image. This video shows the viewer the setup for the PHP watermark as well as important coding language. Continue to Part 2 to learn the core code used in creat…

758 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

Need Help in Real-Time?

Connect with top rated Experts

19 Experts available now in Live!

Get 1:1 Help Now