Register

If this is your first visit, please click the Sign Up now button to begin the process of creating your account so you can begin posting on our forums! The Sign Up process will only take up about a minute of two of your time.

Results 1 to 6 of 6
  1. #1
    Member
    Join Date
    Apr 2004
    Posts
    58
    Member #
    5497
    Grr..

    PHP Code:
      $query "SELECT username,password FROM admins WHERE username = '$login_user' AND password = '$login_pass'";
      
    $check mysql_query($query$mySQL_Connection);
      if(!
    mysql_fetch_row($check)) {
        print(
    "<ul type=\"square\"><li>Your username and/or password is incorrect. <a href=\"\">Back</a>.</li></ul>");
      }
      else {
        
    $result mysql_fetch_array($check);
        print(
    "Sucessfully logged in: " $result[1]);
      } 
    Now, what is wrong?

  2.  

  3. #2
    Member
    Join Date
    Jan 2004
    Posts
    94
    Member #
    4729
    looks ok to me, what's your error?

    edit: i'm sure you could use if (!check) instead of what you currently have. that error might be from that function call?

  4. #3
    JR
    JR is offline
    Senior Member JR's Avatar
    Join Date
    Nov 2002
    Location
    UK
    Posts
    4,354
    Member #
    257
    you could also try echoing $check instead of actually querying to see if the end result of your query is what you expected. For instance it could be a problem with your login_user variable.
    JR

  5. #4
    Member
    Join Date
    Apr 2004
    Posts
    58
    Member #
    5497
    I'm not getting any errors.

  6. #5
    Member
    Join Date
    Apr 2004
    Posts
    58
    Member #
    5497
    The problem is: when I do the print("Successfully logged in: " . $result[1]);, I am getting nothing from the variable.

  7. #6
    Senior Member toadeny's Avatar
    Join Date
    May 2003
    Location
    Wellington, New Zealand
    Posts
    188
    Member #
    1426
    try printing out the result array to see if anything is in it...

    print_r($result);


Remove Ads

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
All times are GMT -6. The time now is 04:11 AM.
Powered by vBulletin® Version 4.2.3
Copyright © 2019 vBulletin Solutions, Inc. All rights reserved.
vBulletin Skin By: PurevB.com