Учите синтаксис
try {
$conn = new PDO("mysql:host=localhost;dbname=firstbeget_wiki", 'firstbeget_wiki', 'govnofm123');
if (empty($_POST ['name'])) exit ("Поле на заполнено");
if (empty($_POST ['content'])) exit ("Поле на заполнено");
$query = "INSERT INTO message VALUES (NULL , :name, NOW())";
$msg = $conn->prepare($query);
$msg->execute(['name' => $_POST['name']]);
$msg_id = $conn->lastInsertId();
$quert = "INSERT INTO message_content VALUES (NULL , :content, :message_id)";
$msg = $conn->prepare($query);
$msg->execute(['content' => $_POST['content'], 'message_id' => $msg_id]);
header("Location: success.html");
} catch (PDOException $e) {
echo "error" . $e->getMessage();
}