我看代码都对啊,为什么会在修改文章的时候出现错误呢,
You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '' at line 1
<?php
header("Content-type:text/html;charset=UTF-8");
require_once('../connect.php');
//把传递过来的信息入库,在入库之前对搜有信息进行校验。
if(!(isset($_POST['title'])&&(!empty($_POST['title'])))){
echo "<script>alert('标题不能为空');window.location.href='article.add.php';</script>";
}
if(!(isset($_POST['author'])&&(!empty($_POST['author'])))){
echo "<script>alert('作者不能为空');window.location.href='article.add.php';</script>";
}
if(!(isset($_POST['description'])&&(!empty($_POST['description'])))){
echo "<script>alert('简介不能为空');window.location.href='article.add.php';</script>";
}
if(!(isset($_POST['content'])&&(!empty($_POST['content'])))){
echo "<script>alert('内容不能为空');window.location.href='article.add.php';</script>";
}
$id=$_POST['id'];
$title=$_POST['title'];
$author=$_POST['author'];
$description=$_POST['description'];
$content=$_POST['content'];
$dateline=time();
$insertsql="update article set title='$title',author='$author',description='$description',content='$content',dateline='$dateline' where id=$id";
if(mysql_query($insertsql)){
echo "<script>alert('文章修改成功');window.location.href='article.add.php';</script>";
}else{
echo '发布失败';
echo mysql_error();
}
?>
帮我看看吧,老师