I have a MySQL query which works from the command line, but not from PHP.
Can anyone see what I am doing wrong?
$sqlText = 'SELECT FROM customers WHERE login_name=:name
$query = $pdo->prepare($sqlText);
$result = $query->fetch(PDO::FETCH_ASSOC);
SELECT * FROM customers WHERE login_name="a"
Moreover, if really
$password` is `4192dee2f886e99ececbb2eee0d2f37f11257974, then you must be running sha1() twice. Either remove the sha1() from the bind line, or keep $password in the clear.
I'd suggest naming the database column "passwordHash", and the variable either $password if it is in cleartext, or $passwordHash if you already ran sha1() on it. That way, you would have written
and immediately spotted the extra sha1() call.