我的代码有什么问题,因为插入工作正常,但更新不起作用。我已经从 phpmyadmin 复制了 updaet 的查询并将静态值更改为变量
<?php
if (isset($_POST['submitContactInfo'])) {
$socityId = $_SESSION['socityid'];
$city = $_POST['city'];
$pin = $_POST['pin'];
$state = $_POST['state'];
$telephone = $_POST['telephone'];
$mobile = $_POST['mobile'];
$email = $_POST['email'];
$address = $_POST['address'];
$sql = "INSERT INTO `_abc1`.`profile` (SOCIETY_ID,ADDR,CITY,PIN,STATE,TEL,MOBILE,EMAIL) VALUES ('$socityId','$address','$city','$pin','$state','$telephone','$mobile','$email');";
$sql = "UPDATE `_abc1`.`profile` SET `ADDR` = '$address', `CITY` = '$city', `PIN` = '$pin', `STATE` = '$state', `TEL` = '$telephone', `MOBILE` = '$mobile', `EMAIL` = '$email' WHERE `society_profile`.`SOCITY_ID` = '$socityId'; ";
$res = mysql_query($sql);
}
?>