我正在尝试将语言和代码连接为第二个查询并保存到数据库字段litcode。 这是我的代码
$pdo = Database::connect();
$pdo->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);
$sql = "INSERT INTO library (spot,code,language,count) values(?, ?, ?,?);UPDATE library SET litcode = CONCAT(language, code);";
$q = $pdo->prepare($sql);
$q->execute(array($spot,$code,$language,$count));
Database::disconnect();
出现此错误
Fatal error: Uncaught exception 'PDOException' with message 'SQLSTATE[HY093]: Invalid parameter number: number of bound variables does not match number of tokens' in /home/booking/public_html/x/concat.php:46 Stack trace: #0 /home/booking/public_html/x/concat.php(46): PDOStatement->execute(Array) #1 {main} thrown in /home/booking/public_html/x/concat.php on line 5
这是代码$q->execute(array($spot,$code,$language,$count));
中的第5行
如何添加连接词litcode? p>