I don\'t know what is wrong.
$result = $db->query(\"INSERT INTO post_items(`post_id`,`content`,`date`,`user_id`,`category_id`)
VALUES (\'\".$postid.\", \
You have a problem with single quotes. You have a '
just before your $postid
, but not one after. This means that the SQL query will be seeing '$postid, '
as your first variable and then being confused about the remained.
Try changing your SQL to read:
$result = $db->query("INSERT INTO post_items(`post_id`,`content`,`date`,`user_id`,`category_id`)
VALUES ('".$postid."', '".$content."', '".$date."', '".$user_id."', '".$category_id."')");
Hope that helps.