1.获取指定栏目的下的信息总数,比如1500,-- "select count(*) as total from $t where classid=$mycid limit 1" 2.随机出1-1500的10个数字。--- $rand_id=rand(1,$classnum); 来10次,确保不重复。 3.对指定栏目下的所有信息,进行编号(1-1500)。---$empire->query("SET @row_number = 0;"); $jhcsql="select * from $t as t1 join (select (@row_number:=@row_number + 1) AS jhcid,id from $t where classid=$mycid) as t2 where t2.jhcid in($ids) and t1.id=t2.id"; 4.根据随机的结果,用灵动标签调用