미채택 완료

상품 한번만 구매가능하게 하기

Copy
// 한번만 구매가능하도록
$sql = " select it_id from {$g5['g5_shop_cart_table']}
          where mb_id = '{$member['mb_id']}'
             and it_id = '$it_id'
             and ct_status != '취소' and ct_status != '쇼핑'
        ";
$result = sql_query($sql);
for ($i=0; $row=sql_fetch_array($result); $i++)
{
   if (!$row['it_id']) {  
       alert('이미 지원한 캠페인입니다.');
   }
}

/shop/orderformupdate.php 에 넣었는데 여러번 구매가 되네요 ㅠㅠ

소스가 잘못된걸까요?

|

답변 1개 / 댓글 1개

if ($row['it_id']) { 

이렇게 수정하세요..

답변에 대한 댓글 1개

저도 그렇게 해봤지만 안되네요 ㅠㅠ

답변을 작성하려면 로그인이 필요합니다.