<?
//計算符合文章總數 & 初始化分頁變數
$row_num = mysql_fetch_row(mysql_query($strSQL));
$num_rows = $row_num[0];
$max_page = (int)($num_rows/$sizepage);
if ($max_page*$sizepage != $num_rows) $max_page++;
if ($to_page < 1) $to_page = 1;
else if ($to_page > $max_page) $to_page = $max_page;
if ($to_page <=0)
	$m = 0;
else
	$m = ($to_page-1)*$sizepage;
$n = $sizepage;
?>