I have been using PHP 5.0 with MySQL 4.x with MD5 security. Due to circumstance, i have to use PHP 5.3 with bcrypt and PDO for MySQL.
Attached is the sample code that i used from here and adopted. It that does not contain any syntax errors during runtime but it doesn't work. The var_dump in the 'while' statement doesn't give out any output.
$email = strtolower($_POST['email']);
$pw = $_POST['pw'];
$chk_email= $dbh->prepare("SELECT pw FROM users WHERE email = $email");
$chk_email -> execute(array($email));
while($row = $chk_email->fetch(PDO::FETCH_ASSOC)){
$chk_pass = $row['pw'];
$pass_isGood = $bcrypt->verify($_POST['pw'], $chk_pass);
var_dump($pass_isGood);
}
Since i'm totally new in bcrypt and PDO, i'm sure its just syntax issue. Any pointers is much appreciated. Thanx in advance.