$post_stmt->bindValue(':id', $post_id);
$post_stmt->bindValue(':user', $user);
$post_stmt->bindValue(':time', $post_time);
+
+ $comment_stmt = $db->prepare('INSERT into comments VALUES (:id, :post_id, :body)');
+ $comment_stmt->bindValue(':id', uuid_v4());
+ $comment_stmt->bindValue(':post_id', $post_id);
+ $comment_stmt->bindValue(':body', $_POST['comment'] ?? '');
+ $comment_stmt->execute();
$post_stmt->execute();
$db->exec('COMMIT');