请帮助我这个代码我试图更新所以它只删除并留空我花了更多的时间做这个和研究谷歌但没有成功。请任何人帮忙。
尝试{
$query = "UPDATE users
SET mobile=:pmobile, bank=:pbank, account=:paccount
WHERE user_id = :user_id";
$stmt = $DB_con->prepare($query);
$mobile=htmlspecialchars(strip_tags($_POST['pmobile']));
$bank=htmlspecialchars(strip_tags($_POST['pbank']));
$account=htmlspecialchars(strip_tags($_POST['paccount']));
$stmt->bindParam(':pmobile', $pmobile);
$stmt->bindParam(':pbank', $pbank);
$stmt->bindParam(':paccount', $paccount);
$stmt->bindParam(':user_id', $user_id);
if($stmt->execute()){
echo "<div class='alert alert-success'>Record was updated.</div>";
}else{
echo "<div class='alert alert-danger'>Unable to update record. Please try again.</div>";
}
}
catch(PDOException $exception){
die('ERROR: ' . $exception->getMessage());
}
谢谢你提前