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

Online Training Solution

Drastically shorten your training time with WalkMe's advanced online training solution that Guides your trainees to action. Forget about retraining and skyrocket knowledge retention rates.

Question has a verified solution.

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

Build an array called $myWeek which will hold the array elements Today, Yesterday and then builds up the rest of the week by the name of the day going back 1 week.   (CODE) (CODE) Then you just need to pass your date to the function. If i…
Citrix XenApp, Internet Explorer 11 set to Enterprise Mode and using central hosted sites.xml file.
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.
Shows how to create a shortcut to site-search Experts Exchange using Google in the Chrome browser. This eliminates the need to type out site:experts-exchange.com whenever you want to search the site. Launch the Search Engine Menu: In chrome, via you…

733 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