我在“profile_server.php”中有以下代码,但没有任何内容写入数据库,我不知道为什么。我感谢您的帮助 :if(isset($_POST['submit'])){ $id = $_SESSION['id']; // Retrieved from previous session //Declaring variables $country = mysqli_real_escape_string($db, $_POST['country']); $province = mysqli_real_escape_string($db, $_POST['province']); $city = mysqli_real_escape_string($db, $_POST['city']); $sql_u_details = $db->prepare ("UPDATE user_details SET (country, province, city) VALUES (?, ?, ?) WHERE id = ? "); $sql_u_details->bind_param("ssss", $country, $province, $city, $id); $sql_u_details->execute(); mysqli_query($db, $sql_u_details);}
1 回答
烙印99
TA贡献1829条经验 获得超13个赞
将你的sql语句改成如下:
$sql_u_details = $db->prepare ("UPDATE user_details SET country = ?, province = ?, city = ? WHERE id = ?");
- 1 回答
- 0 关注
- 94 浏览
添加回答
举报
0/150
提交
取消