getRowsArray($sql);$smarty->assign("array1","/> getRowsArray($sql);$smarty->assign("array1",">
php查询数据问题
$sql = "select * from db_news_type where flag = '".$flag."' order by px,id";
$row=$conne->getRowsArray($sql);
$smarty->assign("array1",$row);
$pageSize=4; //设置每页记录数
$sql1="select guid,n_class,title,px,pic,date,flag from db_news where flag = '".$flag."' order by px,guid desc limit ".($pageSize * ((empty($_REQUEST['page']) ? 1 : $_REQUEST['page'])-1)).", ".$pageSize;
$sql2="select guid,flag from db_news where flag = '".$flag."'";
$news_array=$conne->getRowsArray($sql1);
$news_array1=$conne->getRowsArray($sql2);
echo $sql1;
$page_url="news_info.php"; //页面url地址
$totalnumber=count($news_array1); //获得总记录数
$midPage=5; //数字导航链接数
page();// 调用分页函数
$smarty->assign("array2",$news_array);
问题是通过foreach遍历array2时把$row也遍历了,请高用解决
------解决方案--------------------
帮顶 额外
------解决方案--------------------
楼主没有说清你的问题呀,最好把前台代码也贴进来。