//显示专题头条开始
$db=new DB_sql;
$db->connect();
$tablename="picnews ";
$pageSize=7;
$goPage=$goPage;
$selcetFields="* ";
$sqlConditions="and status='Y'";
if (trim($sqlConditions)!="") {$sqlConditions=substr($sqlConditions,3);}
$sqlOrders=" group by news_id order by id desc";
$url="$PHP_SELF?$oriVARS"; //===
//返回第一条记录位置、总行数、当前页码和总页码
list($firstRow,$totleRows,$currentPage,$totalPages)=
divpage($tablename,$sqlConditions,$totleRows,$pageSize,$goPage);
//建立并执行查询语句
$strQuery="select $selcetFields from $tablename ";
if (trim($sqlConditions)!=""){$strQuery.="where $sqlConditions ";}
if (trim($sqlOrders)!=""){$strQuery.=" $sqlOrders";}
$strQuery .=" limit $firstRow, $pageSize ";
$db->query($strQuery);
while ($db->next_record()){
list($id,$zhuanti_id,$news_id,$title,$img_name,$abstract)=$db->Record;
?>
";}?>
|
[进入焦点图片]
|
}?>
$pageSize){divpage_link($url,$currentPage,$totalPages);} //建立分页连接显示?>
|
|