[英]PDOStatement wrong result on check
I am having this code: 我有此代码:
$PDOStatement = $pdo->prepare("INSERT INTO users (ID, email, password) VALUES(?, ?, ?)"); if($PDOStatement->execute($uuid, $email,$encrypted_password)) { echo "test"; return true; }
The data gets entered into the DB, but unforunetly the IF is not giving out the echo or the return. 数据被输入到DB中,但是不幸的是,IF没有发出回声或返回。
Thanks in advance! 提前致谢!
You need to pass the parameters as an array: 您需要将参数作为数组传递:
if($PDOStatement->execute($uuid, $email,$encrypted_password))
should be 应该
if($PDOStatement->execute([$uuid, $email,$encrypted_password]))
(Manual: http://php.net/manual/en/pdostatement.execute.php ) (手册: http : //php.net/manual/zh/pdostatement.execute.php )
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.