i used to create a topic, and in that recorder, the topic_last_post_id is zero, surely i got its new topic id. Following i create a new post and user for the new topic. They are fine.
Next, i want to get the topic via "Topic topic = dataAccessDriver.newTopicDAO().selectById(topicId);", but i failed.
Checking the sql : SELECT t.*, p.user_id AS last_user_id, p.post_time, p.attach AS attach FROM jforum_topics t, jforum_posts p WHERE t.topic_id = 17 AND p.post_id = t.topic_last_post_id
i find topic_last_post_id is still zero. I am wondering that we should update the topic_last_post_id for topic when we create a new post.
Any help will be appreciated. [originally posted on jforum.net by qiucx]
Migrated From Jforum.net
posted 8 years ago
After adding the post, you have to update jforum_topics with the generated post_id
Rafael [originally posted on jforum.net by Rafael Steil]