You have set PDO::ERRMODE_EXCEPTION. This means, you should wrap your statements in a try/catch block and test execute()s return code:

try {
    $sth = $conn-&gt;prepare("SELECT * FROM access_users WHERE login = ? AND pass = ?");
    $sth-&gt;bindParam(1, $login);
    $sth-&gt;bindParam(2, $pass);
    if (!$sth-&gt;execute()) {
        $info = $sth-&gt;errorInfo();
        echo 'Error: ' . $sth-&gt;errorCode() . ' (' . $info[2] . ")\n";
    } elseif ($sth-&gt;rowCount() &gt; 0)
    {
        // session stuff,
        // refresh page
    }
} catch (PDOException $e) {
    echo 'Exception: ' . $e-&gt;getMessage() . "\n";
}


and put some trace statements in, of course.

Login users/start session with PDO
I'm looking for a Windows GUI tool to compare the contents of two folders and show which files are different....
