Page 2 of 2

Posted: Tue Dec 02, 2003 5:47 am
by qads
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.

Posted: Tue Dec 02, 2003 6:22 am
by JayBird
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
$db_password contains and associative array of the results of the query.

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

Posted: Tue Dec 02, 2003 8:51 am
by RoMeRz
ah right, cheers m8 :D