帝国CMS教程

sql调用点击排行和顶排行,怎么指定栏目ID?

2009-11-25
[ecmsinfo]"select * from phome_4ecms_news where checked=1 order by diggtop desc,id desc limit 10",10,30,0,24,10,0[/ecmsinfo]

这个是顶的排行

[ecmsinfo]"select * from phome_4ecms_news where newspath >SUBDATE(NOW(),INTERVAL 7 DAY) order by onclick desc limit 10",10,30,0,24,10,0[/ecmsinfo]

这个是点击的排行。。

大虾能告诉我具体怎么改吗!!

因为不按栏目来显示的话。。只要一上新闻就会出现在排行榜!!

select * from phome_4ecms_news where checked=1 and classid in (栏目id1,id2...,idn) order by diggtop desc,id desc limit 10

[ecmsinfo]"select * from phome_4ecms_news where newspath >SUBDATE(NOW(),INTERVAL 7 DAY) order by onclick desc limit 10",10,30,0,24,10,0[/ecmsinfo]


这个按栏目又怎么写呢。。我用顶的方式写输出无内容了!!谢谢大虾。。我知道我很烦。。

select * from phome_4ecms_news where newspath >SUBDATE(NOW(),INTERVAL 7 DAY) and classid=栏目id order by onclick desc limit 10

电话 短信 电脑 客服