답변 1개 / 댓글 5개
채택된 답변
+20 포인트
/shop/item.php 파일 이전상품보기, 다음상품보기 부분 있습니다.
// 이전 상품보기
$sql = " select it_id, it_name from {$g5['g5_shop_item_table']} where it_id > '$it_id' and SUBSTRING(ca_id,1,4) = '".substr($it['ca_id'],0,4)."' and it_use = '1' order by it_id asc limit 1 ";
위에서 order by it_id asc 를 order by it_order asc 로 변경
// 다음 상품보기
$sql = " select it_id, it_name from {$g5['g5_shop_item_table']} where it_id < '$it_id' and SUBSTRING(ca_id,1,4) = '".substr($it['ca_id'],0,4)."' and it_use = '1' order by it_id desc limit 1 ";
위에서 order by it_id desc 를 order by it_order desc 로 변경해보세요.
답변에 대한 댓글 5개
같은 카테고리안에서 출력순서대로 이전과 다음 상품이 보여지는 건가요?
전 이전상품은 출력순서가 1번인 상품이.... 다음상품은 출력순서가 마지막인 상품이 보여지기도 하고
어떤 상품에서는 또 다른 이전 다음 상품이 보여지고 뒤죽박죽 이상합니다. ...ㅠㅠ
// 이전 상품보기
$sql = " select it_id, it_name from {$g5['g5_shop_item_table']} where it_id > '$it_id' and SUBSTRING(ca_id,1,4) = '".substr($it['ca_id'],0,4)."' and it_use = '1' order by it_order asc, it_id asc limit 1 ";
$row = sql_fetch($sql);
// 다음 상품보기
$sql = " select it_id, it_name from {$g5['g5_shop_item_table']} where it_id < '$it_id' and SUBSTRING(ca_id,1,4) = '".substr($it['ca_id'],0,4)."' and it_use = '1' order by it_order desc, it_id desc limit 1 ";
뽁스님이 말씀하신대로 이렇게 수정했는데요...맞는 건가요?
전 이전상품은 출력순서가 1번인 상품이.... 다음상품은 출력순서가 마지막인 상품이 보여지기도 하고
어떤 상품에서는 또 다른 이전 다음 상품이 보여지고 뒤죽박죽 이상합니다. ...ㅠㅠ
// 이전 상품보기
$sql = " select it_id, it_name from {$g5['g5_shop_item_table']} where it_id > '$it_id' and SUBSTRING(ca_id,1,4) = '".substr($it['ca_id'],0,4)."' and it_use = '1' order by it_order asc, it_id asc limit 1 ";
$row = sql_fetch($sql);
// 다음 상품보기
$sql = " select it_id, it_name from {$g5['g5_shop_item_table']} where it_id < '$it_id' and SUBSTRING(ca_id,1,4) = '".substr($it['ca_id'],0,4)."' and it_use = '1' order by it_order desc, it_id desc limit 1 ";
뽁스님이 말씀하신대로 이렇게 수정했는데요...맞는 건가요?
답변을 작성하려면 로그인이 필요합니다.
그런데 말씀해 주신대로 수정해봤는대...
이전상품과 다음상품이 항상 같은 상품으로 보여지게 되네요.ㅠㅠ