PDO prepared statement not working for login system
- by Cortopasta
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];
}