Z
zirzofer
Guest
Ich erhalte folgenden Fehler:
Was mache ich falsch?
Fatal error: Uncaught PDOException: SQLSTATE[HY093]: Invalid parameter number: number of bound variables does not match number of tokens in [...]:185 Stack trace: #0 [...](185): PDOStatement->execute(Array) #1 {main} thrown in [...] on line 185
PHP:
$sql = $pdo->prepare("UPDATE `".$db_table."` SET `login_attempts`=0, `last_login_attempt`:=login_time, `login_ip`:=ip, `login_id`:=login_id WHERE `id`=:user_id");
$args = [
":user_id" => $user_id,
":login_time`" => time(),
":ip" => inet_pton($user_ip),
":login_id" => $login_id
];
var_dump($args);
/*
gibt aus:
array(4) { [":user_id"]=> string(3) "001" [":login_time`"]=> int(1480438222) [":ip"]=> string(16) "" [":login_id"]=> string(128) "entfernt für Forum" }
*/
//in der betreffenden Zeile 185 wird das prepared statement ausgeführt:
if($sql->execute($args) !== true){
Was mache ich falsch?