Hi dear friends. I have an annoying error in php while uploading file in a form. Please help. It is most appreciated. Thanks.
This is the error: UERY FAILED You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near '4', 'published')' at line 1 ?php if(isset($_POST['create_post'])) { $post_title = $_POST['post_title']; $post_category_id = $_POST['post_category_id']; $post_author = $_POST['post_author']; $post_status = $_POST['post_status']; $post_image = $_FILES['image']['name']; $post_image_temp = $_FILES['image']['tmp_name']; $post_tags = $_POST['post_tags']; $post_content = $_POST['post_content']; $post_date = date('d-m-y'); $post_comment_count = 4; move_uploaded_file($post_image_temp, "../images/$post_image"); $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}') ";