【发布时间】:2018-10-28 20:57:28
【问题描述】:
我试图在 sqlite 的另一个引用中引用一个变量。现在我有这个,它只是错误
SQLSTATE[HY000]:一般错误:25 绑定或列索引超出范围
问题出在(filmnummer, acteurnummer) VALUES (film.?.filmnummer,?);"线上,我知道这是错误的,但我不知道用什么替换它,所以它可以工作。
public function add_film($title, $genre, $actor, $director, $agecategory, $warning){
$query = $this->db->prepare(
"INSERT INTO film
(title, agecategorynumber) VALUES (?,?);
INSERT INTO filmactor
(filmnummer, actornumber) VALUES (film.?.filmnumber,?);"
);
$query->bindValue(1, $title);
$query->bindValue(2, $agecategory);
$query->bindValue(3, $title);
$query->bindValue(4, $actor);
try{
$query->execute();
}catch(PDOException $e){
die($e->getMessage());
}
}
【问题讨论】: