I have a simple PHP login script that checks username and password in a table called 'user' in a database called 'secret'.
The PHP script is checking as such:
$db = mysql_connect("localhost", "myuser", "mypassword");
mysql_select_db("secret")
SELECT id from user WHERE username = '$user' AND password = MD5('$pass');
$user and $pass are simply the value from the login. THe above SQL query is presenting a empty set for #user and $pass, but does return the id.
So my questions is, how do I add a MD5 password to the password field ( $pass ) for the $user ?
I've tried: SELECT MD5('mypasswordhere'); and this does spit out a MD5 encrypted password for 'mypasswordhere' but how do I get it in the password field?
michael