Im going bananas in this error, when i submit form , can you help me out? thanks in advance
here's the error 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 's perfect. Surround Yourself with English The absolute best way to learn ' at line 1
<?php
include "base.php";
if(isset($_POST['submit'])){
$post_title = $_POST['title'];
$post_date = date('y-m-d');
$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_author=='' or $post_keywords=='' or $post_content=='' or
$post_image==''){
echo "<script>alert('Any of the fields is empty')</script>";
exit();
}
else {
move_uploaded_file($image_tmp,"../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')";
if(mysql_query($insert_query)){
echo "<script>alert('post published successfuly')</script>";
echo "<script>window.open('view_posts.php','_self')</script>";
}
else
{
echo mysql_error();
}
}
}
?>
<?php } ?>