1.给用户提供表单,然后保存设置
2.用union或者缓存查询结果
select * from articles where catid = 1 order by post_time desc limit 10 union
select * from articles where catid = 2 order by post_time desc limit 10 union
......
注:union要求mysql的版本>4.0
2.用union或者缓存查询结果
select * from articles where catid = 1 order by post_time desc limit 10 union
select * from articles where catid = 2 order by post_time desc limit 10 union
......
注:union要求mysql的版本>4.0
最新发表的
-----------------------
2.用union或者缓存查询结果
这样查询出来数据如何判断是哪个分类?
-----------------------------------
看你怎么样显示数据了, 简单的根据文章的cat_id就可以。
也可以取数据时一个分类的文章放到一个数组
while( $res = mysql_fetch_array( $query_id ) )
{
$cat_id = $res['cat_id'];
$article[$cat_id][] = $res;
}