상품 총 팔린 개수 출력
본문
상품이 팔린 총 개수를 출력하기 위해서
item.form.skin.php에 다음과 같이 표현했는데
나오지 않네요. 무엇이 잘못 된건가요?
<?php
$sql = " select a.it_id,
b.*,
SUM(IF(ct_status = '쇼핑',ct_qty, 0)) as ct_status_1,
SUM(IF(ct_status = '주문',ct_qty, 0)) as ct_status_2,
SUM(IF(ct_status = '입금',ct_qty, 0)) as ct_status_3,
SUM(IF(ct_status = '준비',ct_qty, 0)) as ct_status_4,
SUM(IF(ct_status = '배송',ct_qty, 0)) as ct_status_5,
SUM(IF(ct_status = '완료',ct_qty, 0)) as ct_status_6,
SUM(IF(ct_status = '취소',ct_qty, 0)) as ct_status_7,
SUM(IF(ct_status = '반품',ct_qty, 0)) as ct_status_8,
SUM(IF(ct_status = '품절',ct_qty, 0)) as ct_status_9,
SUM(ct_qty) as ct_status_sum
from {$g5['g5_shop_cart_table']} a, {$g5['g5_shop_item_table']} b ";
$sql .= " where a.it_id = b.it_id ";
$result = sql_query($sql);
?>
<?php echo $result['ct_status_1']; ?>건
답변을 작성하시기 전에 로그인 해주세요.