PDO prepared statement not working for login system
Posted
by Cortopasta
on Stack Overflow
See other posts from Stack Overflow
or by Cortopasta
Published on 2010-05-29T18:50:41Z
Indexed on
2010/05/29
18:52 UTC
Read the original article
Hit count: 352
Anybody no what I'm doing wrong here? I have a username and password hashed in my database, but i can't seem to get it to match the one I submit through the script.
$res = $dbcon->prepare('SELECT id FROM users WHERE name = :name AND password = MD5(:password)');
$res->bindParam(':name', $user);
$res->bindParam(':password', $password);
$res->execute();
$row = $res->fetch();
for ($i=0; $i<7; $i++)
{
$row[$i];
}
© Stack Overflow or respective owner