"; $page=$_REQUEST["page"]; $sql = "SELECT * FROM `cdb_posts` WHERE `subject` LIKE '%ae22%' OR `message` LIKE '%ae22%' HAVING first=1 and fid=1 and tid >1428 order by tid desc"; mysql_query("set names gbk"); $result=mysql_query($sql); $total= mysql_numrows($result); if(!$page)$page =0; $eachpage=8; $start=$page*$eachpage; $end=$start+$eachpage; if($end>$total) $end =$total; $totalpage =round($total/$eachpage); $str=$str.""; $str=$str.""; $str=$str."".$total.""; $str=$str."".$totalpage.""; $str=$str.""; if ($total==0) { $str=$str.""; $str=$str."暂无网友评论,请到论坛发表评论!"; $str=$str."\r\n"; } else { for ($i=$start; $i<$end; $i++) { $str=$str.""; $str=$str."".mysql_result($result,$i,"subject").""; $str=$str.""; }} mysql_close; $str=$str.""; echo $str; ?>