connectdb(DB_NAME,DB_USERNAME,DB_PASSWORD); $limit =10; $SUMPAGE = $db->num_rows(TB_NEWS,"id","$SQLwhere"); $page=$_GET[page]; if (empty($page)){ $page=1; } $rt = $SUMPAGE%$limit ; $totalpage = ($rt!=0) ? floor($SUMPAGE/$limit)+1 : floor($SUMPAGE/$limit); $goto = ($page-1)*$limit ; $res[news] = $db->select_query("SELECT * FROM ".TB_NEWS." $SQLwhere2 ORDER BY id DESC LIMIT $goto, $limit "); $count=0; while($arr[news] = $db->fetch($res[news])){ if ($count==0) { echo ""; } //???????????? $res[category] = $db->select_query("SELECT category_name FROM ".TB_NEWS_CAT." WHERE id='".$arr[news][category]."' "); $arr[category] = $db->fetch($res[category]); ?>