gpt4 book ai didi

Php PDO插入查询报错

转载 作者:太空宇宙 更新时间:2023-11-03 11:00:55 24 4
gpt4 key购买 nike

<分区>

我正在尝试运行此代码以在我的“问题”表中插入一个新行:

$sql = "INSERT INTO questions (id,quiz_id,question,image,type,option,answer,explanation,date) 
VALUES (:id, :quiz_id, :question, :imagesstring, :type, :optionsstring, :answer, :explanation, :date)";
$query = $db->prepare($sql);
$results = $query->execute(array(
":id" => $id,
":quiz_id" => $quiz_id,
":question" => $question,
":imagesstring" => $imagesstring,
":type" => $type,
":optionsstring" => $optionsstring,
":answer" => $answer,
":explanation" => $explanation,
":date" => $date
));

它说附近有语法错误,但我找不到它。我多次检查了表格,列与我插入的变量相对应。变量也有分配给它们的正确值。请帮忙。

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com