php利用语法更新失败怎么办?

2025年02月23日 建站教程

php利用语法更新失败怎么办?下面web建站小编给大家详细介绍一下解决方法!

php更新语句失败了!看语法

<?
$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= '女'

本文链接:http://so.lmcjl.com/news/23693/

展开阅读全文
相关内容