function getask(){
$sql = "select * from cms_ask where ansower <> ' ' ";
//ここで必要な変更方法
$q_sq = mysql_query($sql);
$count = mysql_num_rows($q_sq);
$page_size = 8;
$page_current = isset($GLOBALS['page']) ? intval($GLOBALS['ページ']) : 1;
$page_count = ceil($count / $page_size);
$page_start = $page_current - 4;
$page_end = $page_current + 4;
if ($page_current < 5) {
$page_start = 1;
$page_end = 5;
}
if ($page_current > $page_count - 4) {
$page_start = $page_count - 8;
$page_end = $page_count;
}
if ($page_start $page_start = 1;
if ($page_end > $page_count)
$page_end = $page_count;
$pagebar = "";
$sql = "select * from cms_ask where ansower <> ' ' order by id desc limit " . (($page_current - 1) * $page_size) 。 「、」。 $page_size;
$row=$this ->ユーザー -> getall("$sql");
foreach($row as $v){
echo '
- 问:'.$v["question"].'
- 答:'.$v[ "ansower"].date("Y-m-d H:i:s",$v["postTime"]).'
';
}
$pagebar .= "
";
$pagebar .= "
";
if ($page_current != 1) {
$pagebar .= '- FIRST
';
}
for ($i = $page_start; $i if ($i == $page_current) {
$pagebar .= "- " 。 $i 。 "
";
} else {
$pagebar .= "- " 。 $i 。 "
";
}
}
if ($page_current != $page_count) {
$pagebar .= " ";
}
$pagebar .= "
";
$pagebar .= "
";
echo $pagebar;
}