Heim > Fragen und Antworten > Hauptteil
P粉3156805652023-08-25 17:13:59
更改为:
$sth = "更新 rpacks SET rpacks_location = :location WHERE rpacks_id = :id";
P粉2486022982023-08-25 13:33:14
您的 update
查询中存在错误,因为您使用了 insert
查询语法。
以下是正确的查询:
$sql = "UPDATE rpacks SET rpacks_location = :location WHERE rpacks_id = :id"; $stmt = $conn->prepare($sql); $stmt->execute([':location'=>$location, ':id'=>$id]);
参考: http://dev.mysql.com/doc/refman/5.0/ en/update.html