10){ $page_num = $all_num / 10; //あまりの件数はありますか? 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) * 10; $sql = "select * from service_tbl where creater_id = '".$_GET['creater_id']."' order by regist_date desc limit ".$start.", 10"; $result = db_sql($sql, $conn_id); //SQL実行 ?> <? echo $prof_row['name'] ?>|ツクログ

$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; } ?>

= 60){ $pr_txt = mb_substr($row['pr_txt'], 0, 60, 'UTF-8')."..."; }else{ $pr_txt = $row['pr_txt']; } //写真のパス if($row['image_pic01'] != ""){ $pic = explode(".",$row['image_pic01']); $top_pic = $pic[0]."top.".$pic[1]; $size = @getImageSize(".".$top_pic); }else{ $top_pic = "/common/images/noimage02.gif"; $size = @getImageSize(".".$top_pic); } ?>

sample

リリース日:

詳しく読む

まだ投稿はありません。

$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; } ?>