10){ $page_num = $all_num / 162; //あまりの件数はありますか? if($all_num % 10 != 0){ $page_num ++; $page_num = floor($page_num); } }else{ $page_num = 1; } //該当ページの指定がない場合 if($_GET['page'] == "" || $_GET['page'] == 0){ $page_no = 1; //該当ページの指定がある場合 }else{ $page_no = $_GET['page']; } //10件づつ表示 $start = ($page_no - 1) * 162; $sql = "select * from creater_tbl order by regist_date desc limit ".$start.", 162"; $result = db_sql($sql, $conn_id); //SQL実行 ?> クリエイター一覧|ツクログ

クリエイター一覧

$start + 10){ $disp_end = $start + 10; }else{ $disp_end = $all_num; } //10ページまで表示 if($page_num > 10 && $page_no <= $page_num - 9){ $start_page = $page_no; }else if($page_num > 10 && $page_no > $page_num - 9){ $start_page = $page_num - 9; }else{ $start_page = 1; } if($page_no == $page_num || $page_num <= 10){ $end_page = $page_num; }else{ $end_page = $start_page + 9; } //前のページへ表示 if($page_no != 1 && $page_num > 10){ $back = $page_no - 1; $page_html = $page_html."<<"; } //**** ページ移動処理 for($page_cnt = $start_page; $page_cnt <= $end_page; $page_cnt++){ if($page_no == $page_cnt){ $page_html = $page_html."".$page_cnt.""; }else{ $page_html = $page_html."".$page_cnt.""; } } //次のページへ表示 if($page_no <= $page_num - 9 && $page_num > 10){ $next = $page_no + 1; $page_html = $page_html.">>"; } echo $page_html; } ?>
$start + 10){ $disp_end = $start + 10; }else{ $disp_end = $all_num; } //10ページまで表示 if($page_num > 10 && $page_no <= $page_num - 9){ $start_page = $page_no; }else if($page_num > 10 && $page_no > $page_num - 9){ $start_page = $page_num - 9; }else{ $start_page = 1; } if($page_no == $page_num || $page_num <= 10){ $end_page = $page_num; }else{ $end_page = $start_page + 9; } //前のページへ表示 if($page_no != 1 && $page_num > 10){ $back = $page_no - 1; $page_html = $page_html."<<"; } //**** ページ移動処理 for($page_cnt = $start_page; $page_cnt <= $end_page; $page_cnt++){ if($page_no == $page_cnt){ $page_html = $page_html."".$page_cnt.""; }else{ $page_html = $page_html."".$page_cnt.""; } } //次のページへ表示 if($page_no <= $page_num - 9 && $page_num > 10){ $next = $page_no + 1; $page_html = $page_html.">>"; } echo $page_html; } ?>