There are 3 tables,
- Remove the last 10 comments from the database and display information about the author.
- Print the last 5 responses to the comment from the database and display information about the author.
post_id- post id
post_news_id- id news where the comment is left
post_autor_id- comment author id
post_text- comment text
post_type- comment type (1 - comment, 2 - reply to comment)
post_idcom- if the post is the answer then there is an id on which the comment was made the answer
uid- user id
All I could do is output this comment and info about the comment author.
SELECT * FROM comment_table LEFT JOIN user_table ON comment_table.post_autor_id=user_table.uid WHERE post_news_id = '".$_GET[news_id]."' ORDER BY post_id DESC LIMIT 80
It is necessary that all this was in 1 request - not requests in a cycle.