您好,欢迎访问一九零五行业门户网

php更新语句执行失败怎么办

php更新语句执行失败的解决办法:1、打开相应的php文件;2、找到“update set name='1231' from xsb where sex= '...'”语句;3、修改更新语句为“update set from xsb name='1231' where sex= '...'”即可。
本教程操作环境:windows7系统、php8.1版、dell g3电脑。
php更新语句执行失败怎么办?
具体问题描述:
php update语句无法执行呢
<?$con=mysql_connect('localhost','root','1') or die('连接失败');mysql_select_db('xsxx1',$con) or die('选择数据库失败');mysql_query("set names gb2312");$updatesql="update set name='1231' from xsb where sex= '女' ";$update = mysql_query($updatesql,$con);// 检测修改操作是否成功if ($update){echo "修改记录成功!";echo "<br>";}else{echo "修改记录失败!";echo "<br>";}?>
这是我写的代码,总是显示失败,为什么呢?
问题解决办法:
update set name='1231' from xsb where sex= '女'
改为
update set from xsb name='1231' where sex= '女'
推荐学习:《php视频教程》
以上就是php更新语句执行失败怎么办的详细内容。
其它类似信息

推荐信息