I am trying to get data from the database like that, but i have this error how can i fix?
SELECT post.text,users.name,users.surname,users.profile_id,post.post_id,comments.text as comment,
(SELECT user.name, user.surname FROM users user WHERE profile_id = comments.profile_id) as name_comment
FROM post
INNER JOIN users ON users.profile_id = post.profile_id
INNER JOIN comments ON comments.profile_post = post.post_id