PHP头条
热点:

php从帖子表读出数据进行排序有关问题


php从帖子表读出数据进行排序问题
posts帖子表
posts_hot帖子相关信息表
posts_hot表ID关联Posts表
posts_hot表中的hot_top是表示该帖子置顶
posts表中的posts_dt_time是表示该帖子最新回复时间
问题是:根据论坛ID读出帖子列表,让帖子置顶在保持在最上面,其他的按最新回复时间排序!
sql
select p.*,u.*,ph.* from posts p,users u,posts_hot ph where p.forumid=$forumid and p.userid=u.user_id and p.hotid=ph.hot_id order h.hot_top;
这样只能按置顶的在前面,后面添加posts_dt_time就乱了,有什么办法解决么,我不想再分出SQL来查询了!
分享到: 更多

相关文章

相关频道:

PHP之友评论

今天推荐