just do
SELECT username FROM users WHERE username='$username' AND password = '$password'
with this you dont need to compare the password outside the query, less lines of code in other words.
login script *rips hair out*
Moderator: General Moderators
$db_password contains and associative array of the results of the query.RoMeRz wrote:can i ask,
$db_password = $db_password['password'];
could someone explain this for me please. I just quite understand what the ['password'] bit at the end is for.
ta
so $db_password['password'] will contain whatever was in the password field of the MySQL Database.
Read [php_man]mysql_fetch_array[/php_man]
Mark