我有4个表:获取最后发表的帖子在每个类别
1. forums (id,forum_id,name,group_id) - there are categories and
sub-categories
2. topics (id,forum_id,user_id,name,dt,deleted[default - 0])
3. posts (id,topic_id,text,edit_dt,user_id,deleted)
4. users (id,name)
什么是让大类最新文章的最佳方式?或者在论坛表中增加新的字段 - last_post_id
,last_post_name
,last_post_dt
,并在delete,
添加新主题/回复更新这些字段?
您的列不包含任何类别列。请编辑您的问题,并提供样本数据和期望的结果。 –
你可以在论坛表中添加一个时间戳列 – Akg
orderby id DESC看起来似乎很简单,除非我丢失了一些东西 – ggdx