如何准备更新查询语句?[重复]

如何准备更新查询语句?[重复],第1张

如何准备更新查询语句?[重复]

一个

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();


欢迎分享,转载请注明来源:内存溢出

原文地址:https://54852.com/zaji/5112441.html

(0)
打赏 微信扫一扫微信扫一扫 支付宝扫一扫支付宝扫一扫
上一篇 2022-11-17
下一篇2022-11-17

发表评论

登录后才能评论

评论列表(0条)

    保存