I have the following table as attached. Please ignore the realm_id column. The only columns of concerned are id, parent_id, child_id, des, name, create_t and author.
parent_id is the primary topic number.
child_id is the reply number (higher means latest post) to that particular topic. 1 means its the first post of the topic.
des is the message itself.
nameis the topic title
create_t is the create time of the topic / reply
author is the creator of the topic / reply
How can i display in a table form accordingly from lastest post to oldest? My displayed table looks like:
Topic | Posts | Last Poster | Last Date Posted
where topic is the topic name
Posts is the number of posts in that topic (count from child_id)
Last poster is the author of the lastest poster of the topic (search for largest child_id)
Last Date Posted is the date created for the post.
I've a general concept but just can't seems to get my code (very complicated and messy:queasy: )working. Think there should be a more organised method to this problem..
Any help / comment is appreciated. Thanks ๐