When I remove '$user' and by this works perfectly
$query = $db -> query("INSERT INTO posts (title, body, tags, published, date, by) VALUES
('$title', '$body', '$tags', '$published', '$date', '$user')");
User is varchar(11)
when I print_r $user I get the value I want
I am not sure what is going on, by
is at the end of the table.
Sorry if this question is stupid.
peace