[مساعدة] بخصوص كود php لإضافة مشاركة / تدوينة

السلام عليكم

لأ أعلم ما المشكلة في هذا الكود فعندما أحاول أن أضيف تدوينة تظهر هذه الرسالة :

faildYou have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'xscd','scd',now(),'','','','4','')' at line 1

وهذا هو كوذ الـ Php

    $query = " INSERT INTO `posts` ( post_category_id, post_title, post_author, post_date, post_image, post_content, post_tags, post_comment_count, post_status )";
    $query .= "VALUES ($post_category_id','{$post_title}','{$post_author}',now(),'{$post_image}','{$post_content}','{$post_tags}','{$post_comment_count}','{$post_status}')";

    $create_post_query= mysqli_query($connection, $query);
    if (!$create_post_query) {
        die("faild" . mysqli_error($connection));
    }

التعليق السابق

أخي @راشد المري

نفس المشكلة :

faildYou have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ''electric and hybrid cars' , 'elmelali', NOW(), '', '', '' ,'4' ,'')' at line 1

قد تكون الحقول

post_image

post_content

post_tags

post_status

في قاعدة البيانات حقول اجبارية (NOT NULL)

بينما القيم المُدخلة وهم المتغيرات

$post_image

$post_content

$post_tags

$post_status

خالية من القيم. تأكد من ذلك، أن لم تعمل ارسل لي الملف كاملاً.