Group by total_count sql_num_rows > 자료실

자료실

자료실

Group by total_count sql_num_rows

페이지 정보

profile_image
작성자 최고관리자
댓글 1 조회 342회 작성일 23-02-20 17:24
작성일 23-02-20 17:24

본문

$sql = '';

$sql .= "SELECT";

$sql .= " od_id";

$sql .= " FROM {$g5['g5_shop_order_table']}";

$sql .= " WHERE od_id > 0";

$sql .= " AND mb_id = '{$mb_id}'";

$sql .=" AND ( od_status IN('입금', '준비', '배송', '완료'))";

$sql .= " ORDER BY od_time DESC";

$result = sql_query($sql);

$total_count = sql_num_rows($result);


// 리스트용 sql

$rows = $bcount;

$total_page  = ceil($total_count / $rows);  // 전체 페이지 계산

$from_record = ($page - 1) * $rows; // 시작 열을 구함

 

$sql = $sql . " LIMIT ".$from_record.", ".$rows." ";

$result = sql_query($sql);

추천 1 비추천 0
profile_image

총모아 님의 댓글

총모아 작성일

자주 사용하지 않는데 찾아서 사용하려면 애를 먹었는데


  • 회사 :
  • 대표 :
  • 주소 :
  • 메일 : admin@mysample.com
  • 사업자 등록번호 :
Copyright © cginjs.com All rights reserved.
notice