php中mysql执行问题
include("conn.php");
$yuanxi=$_POST[yuanxi];
if($yuanxi==""){
echo"没有填写院系";
}
else{
$sql="update yuanxi set yuanxi=".$yuanxi." where id=".$_POST[id];
mysql_query($sql) or die("数据库编辑失败");
echo"院系编辑成功";
}
?>
sql语句总是执行错误,应该是sql语句问题,不知道什么问题,
------解决方案--------------------
echo 出sql,放到mysql中执行看看,还有 $_POST[yuanxi] 请加上引号
PHP怎么学习?PHP怎么入门?PHP在哪学?PHP怎么学才快?不用担心,这里为大家提供了PHP速学教程(入门到精通),有需要的小伙伴保存下载就能学习啦!
Copyright 2014-2025 https://www.php.cn/ All Rights Reserved | php.cn | 湘ICP备2023035733号