一个
UPDATE与插入或选择相同。只需将所有变量替换为
?。
$sql = "UPDATE Applicant SET phone_number=?, street_name=?, city=?, county=?, zip_pre=?, day_date=?, month_date=?, year_date=? WHERe account_id=?";$stmt = $db_usag->prepare($sql);// This assumes the date and account_id parameters are integers `d` and the rest are strings `s`// So that's 5 consecutive string params and then 4 integer params$stmt->bind_param('sssssdddd', $phone_number, $street_name, $city, $county, $zip_pre, $day_date, $month_date, $year_date, $account_id);$stmt->execute();if ($stmt->error) { echo "FAILURE!!! " . $stmt->error;}else echo "Updated {$stmt->affected_rows} rows";$stmt->close();

![如何准备更新查询语句?[重复] 如何准备更新查询语句?[重复]](http://www.mshxw.com/aiimages/31/432714.png)
