php语法错误($keywords_ '_ ');,意外的错误消息在PHP表单(SQL语法错误)

我已经做了一个简单的PHP数据库的cms表单,但它不能正常工作,当我想提交表单与一些虚拟数据!我不知道为什么会发生&也是我加入了mysqli_error()得到错误的,我现在面临与类型,但我只拿到了这一点:意外的错误消息在PHP表单(SQL语法错误)

您的SQL语法错误;检查对应于你的MySQL服务器版本正确的语法使用手动近“”,“”,“在行”)” 2

if (isset($_POST['submit'])){

$post_title = $_POST['title'];

$post_date = date('d-m-y');

$post_author = $_POST['author'];

$post_keywords = $_POST['keywords'];

$post_content = $_POST['content'];

$post_image = $_FILES['image']['name'];

$image_tmp = $_FILES['image']['tmp_name'];

if ($post_title=='' or $post_keywords='' or $post_content='' or $post_author=''){

echo '';

}else{

move_uploaded_file($image_tmp,"post_images/$post_image");

$insert_query = "INSERT INTO posts

(post_title,post_date,post_author,post_image,post_keywords,post_content) VALUES ('$post_title','$post_date','$post_author',$post_image','$post_keywords','$post_content')";

$insert_post = mysqli_query($con,$insert_query);

if ($insert_post){

echo '

Post has been added successfully.

';

}else{

echo mysqli_error($con);

}

}

}

?>

Insert Post Title
Insert Post Author
Insert Post Keywords
Insert Post Image
Insert Post Content

如果您分享您的解决方案这将是对我很有帮助对于这个问题...谢谢!

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值