You log in to mysql8.wannafind.dk? Then that’s presumably your database server. Substitute “localhost” with that URL (“mysql8.wannafind.dk”).
The line giving you the error is this:
$parent_title = ($parent_id->post_title);
The error is that you’re trying to retrieve the post title from the parent id. What you need is this:
$parent_title = ($parent_post->post_title);
echo $parent_title;
Notice: $parent_post, not $parent_id.