password function makes invalid login...help :(
Posted: Sat Sep 16, 2006 1:53 am
ok i got a very simple login script working but the problem is that it wont find the table when it searches for it using this code:
But, it finds the users in the table with this:
Also, my register.php works and adds the user to the Database as my get_users.php file shows a list and its there. When i use the 2nd sql it works if i manually enter a user into the database...which basically, if the password is not encypted, the search finds the user, but if it is encrypted (using the register.php) it fails to find it.
Can anybody help me out and find out why it wont find it with the password encrypted?
Sorry im new to php but i have had experience with java so sorry if i seem confused....cos i am.
Thanks, ps2cho
Code: Select all
$sql = "select * FROM `users` WHERE user_name='$username' AND password=password('$password')";Code: Select all
$sql = "select * FROM `users` WHERE user_name='$username' AND password='$password'";Can anybody help me out and find out why it wont find it with the password encrypted?
Sorry im new to php but i have had experience with java so sorry if i seem confused....cos i am.
Thanks, ps2cho