전체페이지보다 현재페이지가 클때 데이타가 안나오는 경우 > 자료실

회원로그인

오늘 본 게시물

오늘 본 페이지

없음

오늘 본 C.m.A Util

없음

자료실

자료실

전체페이지보다 현재페이지가 클때 데이타가 안나오는 경우

페이지 정보

본문


// 테이블의 전체 레코드수만 얻음
$_tot_sql = " SELECT count(*) AS cnt " . $sql_common;
$_tot_row = sql_fetch($_tot_sql);
$total_count = $_tot_row[cnt];

$rows = $bcount;
$total_page  = ceil($total_count / $rows);  // 전체 페이지 계산
$from_record = ($page - 1) * $rows; // 시작 열을 구함

if($total_count < $rows) : // 현재페이지 토탈건수
    $page_total_count = $total_count;
else :
    $page_total_count = $rows;
endif;

if($save_excel == "yes") : // 엑셀저장
    $_limit_common = "";
else : // 엑셀모드가 아닐때
    if($page > $total_page) : // 페이지 변경시 전체페이지보다 현재 페이지가 클때 $from_record 초기화​
        $from_record = 0;
    endif;

    $_limit_common = " LIMIT ".$from_record.", ".$rows." ";
endif;

$sql  = " SELECT ";
$sql  .= " * ";
$sql  .= $sql_common." ".$sql_order." ".$_limit_common;





추천 0 비추천 0

  • 회사 : Cginjs
  • 대표 : Cginjs
  • 주소 :
  • 메일 : admin@mysample.com
  • 사업자 등록번호 :
Copyright © Cginjs All rights reserved.
notice
Warning: Undefined variable $HTTP_ACCEPT_LANGUAGE in /cginjs/www/bbs/visit_insert.inc.php on line 131