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.
Comment Table
comment_table
post_id
- post idpost_news_id
- id news where the comment is leftpost_autor_id
- comment author idpost_text
- comment textpost_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
User table
user_table
uid
- user idnikname
- nicknameavarar
- avatar
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.