I have made a simple php cms form with database but it does not work properly when I want to submit the form with some dummy data! I don\'t know why it happens & also I adde
You are missing a quote just before $post_image:
,$post_image'
Should be:
,'$post_image'
So the complete SQL statement becomes then:
$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')";
Please note that you are doing assignments in this if
:
if ($post_title=='' or $post_keywords='' or $post_content='' or $post_author=''){
You should be using double ==
instead of =
.
Finally, your code is vulnerable to SQL injection. So please use prepared statements with parameters.