#1
  1. No Profile Picture
    Junior Member
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jul 2000
    Location
    Yokohama, Kanagawa, Japan
    Posts
    1
    Rep Power
    0
    I just heard of PHP a week ago, so bear with me.
    I want to compare $PHP_AUTH_PW to a crypted password in a MySQL database. I know this isn't right, but this is what I'm working with right now -
    $sql = "SELECT * FROM individual_info WHERE username='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW'";
    I think the problem is I need to get the $PHP_AUTH_PW crypted the same way MySQL crypted the one in the database, but I don't know how. Thanks for your patience.
  2. #2
  3. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jul 2000
    Posts
    35
    Rep Power
    15
    How was the password in the database crypted in the first place?

    If it is part of the mySQL access table and was generated with a GRANT statement, try using the PASSWORD function.

    ie.

    select * from TABLE where pass=password($PASS_VAR)

    HTH
    Marty

IMN logo majestic logo threadwatch logo seochat tools logo