Home > Backend Development > PHP Tutorial > php中mysql执行有关问题

php中mysql执行有关问题

WBOY
Release: 2016-06-13 13:08:57
Original
958 people have browsed it

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] 请加上引号

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template