Page 1 of 1

Need help with mysql password comparing

Posted: Mon Jun 11, 2007 9:14 am
by mutari
I have this mysql query (below) in php to compare password in my database. The script below is not working. Can someone kindly advice.
Thanx


$getUser = $loginConnector->query("SELECT * FROM cmsusers WHERE user = '".$_SESSION['user']."' AND pass = PASSWORD('".$_SESSION['pass']."') AND thegroup <= ".$group." HAND enabled = 1");

Posted: Mon Jun 11, 2007 9:27 am
by superdezign
Have you tried outputting the query itself to the browser to see what values are being put into it?

Posted: Mon Jun 11, 2007 9:31 am
by mutari
yes. everything looks ok, but when it comes to camparing passwords i get no output. is there any syntax error with the query line because i can't see any.

Posted: Mon Jun 11, 2007 2:30 pm
by feyd
Do not use the PASSWORD() function. It was designed explicitly for MySQL use only, not end-users of it.

I would suspect "HAND" is incorrect.