dpus81500574 2016-03-08 23:51
浏览 13

我的SQL查询中有错误吗?

I want to update my user_info table but it's not working. In my user_info I have already taken some values from one activity and from another activity I want to take some more values but it's not working. I'm pretty sure that there is no error in my Java code.. is there any error in my query?

$db_name = "db";
$mysql_user = "root";
$mysql_pass = "";
$server_name = "localhost";

$con = mysqli_connect($server_name, $mysql_user, $mysql_pass, $db_name);

$name = $_POST["user"];
$user_email = $_POST["user_email"];
$Gender = $_POST["Gender"];
$contact = $_POST["contact"];
$address = $_POST["address"];

$sql_query = "UPDATE user_info SET name='$name', Gender='$Gender', contact='$contact', address='$address' WHERE user_email='$user_email'";
mysqli_query($con,$sql_query)

mysqli_close($con);
  • 写回答

1条回答 默认 最新

  • douyanti2808 2016-03-08 23:59
    关注

    Im not sure without seeing you database table but "Gender" is capitalized while the other field names are lowercase. Just a shot in the dark here, otherwise your query looks fine.

    评论

报告相同问题?

悬赏问题

  • ¥20 求个正点原子stm32f407开发版的贪吃蛇游戏
  • ¥15 正弦信号发生器串并联电路电阻无法保持同步怎么办
  • ¥15 划分vlan后,链路不通了?
  • ¥20 求各位懂行的人,注册表能不能看到usb使用得具体信息,干了什么,传输了什么数据
  • ¥15 个人网站被恶意大量访问,怎么办
  • ¥15 Vue3 大型图片数据拖动排序
  • ¥15 Centos / PETGEM
  • ¥15 划分vlan后不通了
  • ¥20 用雷电模拟器安装百达屋apk一直闪退
  • ¥15 算能科技20240506咨询(拒绝大模型回答)