我在查询或其他任何地方都没有错误,但它给了我错误
绑定变量数与令牌数不匹配,参数号无效SQLSTATE [HY093]:
码
public function updatePost($id, $package_name, $package_description, $package_duration, $package_price, $package_type, $location, $file_name, $status)
{
$db = $this->getDB();
$statement = $db->prepare("UPDATE packages
SET package_name =:package_name, package_description = :package_description, package_duration = :package_duration, package_price = :package_price, package_type = package_type, location = :location, image = :image, status = :status WHERE id = :id");
$arrayValues = array(
'id' => $id,
'package_name' => $package_name,
'package_description' => $package_description,
'package_duration' => $package_duration,
'package_price' => $package_price,
'package_type' => $package_type,
'location' => $location,
'image' => $file_name,
'status' => $status
);
$statement->execute($arrayValues);
print_r($statement);
}
我在哪里错了...请帮助我。
答案 0 :(得分:3)
您错过了:查询中的package_type。