Need help with mysql password comparing

Questions about the MySQL, PostgreSQL, and most other databases, as well as using it with PHP can be asked here.

Moderator: General Moderators

Post Reply
mutari
Forum Newbie
Posts: 2
Joined: Mon Jun 11, 2007 9:04 am

Need help with mysql password comparing

Post 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");
User avatar
superdezign
DevNet Master
Posts: 4135
Joined: Sat Jan 20, 2007 11:06 pm

Post by superdezign »

Have you tried outputting the query itself to the browser to see what values are being put into it?
mutari
Forum Newbie
Posts: 2
Joined: Mon Jun 11, 2007 9:04 am

Post 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.
User avatar
feyd
Neighborhood Spidermoddy
Posts: 31559
Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA

Post 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.
Post Reply