As per your submitted code there is a syntax error in line 9
$query = "INSERT INTO posts(title,content) VALUES('$title',$content')";
This should change as
$query = "INSERT INTO posts(title,content) VALUES('$title','$content')";
Reason you are missing a quote before
$content