使用PDO查询的MySQL语法错误

Som*_*neS -1 php pdo

我试图与PDO一起使用mysql函数FROM_UNIXTIME:

$sth = $dbh->prepare("UPDATE ".DB_PREFIX."_logins SET num_of_trys = num_trys-1, 
       last_try = FROM_UNIXTIME(:last_try), WHERE username = :username 
       OR ip = :ip");
$sth->bindParam(':ip', $ip); 
$sth->bindParam(':username', $user);
$sth->bindParam(':last_try', $lst);
$sth->execute();
Run Code Online (Sandbox Code Playgroud)

但我收到错误消息.什么是正确的方法呢?

这是错误消息:

Fatal error: Uncaught exception 'PDOException' with message 'SQLSTATE[42000]: 
             Syntax   error or access violation: 1064 You have an error 
             in your SQL syntax; check the manual that corresponds to your 
             MySQL server version for the right syntax to use near 
             'WHERE username = 'sadas' OR ip = '1834871734'' at line 1' 
              in /pathtofile/acc_functions.php:72 Stack trace: #0 
              /pathtofile/acc_functions.php(72): PDOStatement->execute() #1 
              /pathtofile/login.php(44): check_login_attempts(1834871734, 
              1343941422, 'sadas') #2 {main} thrown in 
              /pathtofile/acc_functions.php on line 72
Run Code Online (Sandbox Code Playgroud)

rid*_*rid 6

删除,之前的角色WHERE.