login_chack.skin 채택완료
로그인을할때 현제까지 누적금액을 계산해서 등급을 자동으로 높히려고하는대요..
</strong></p>
<p>if($mb_level['mb_level'] < 10){</p>
<p> $sql = "select sum(a.od_cart_price) od_cart_price from {$g5['g5_shop_order_table']} a inner join {$g5['member_table']} b on a.mb_id = b.mb_id where a.od_status = '완료' and a.mb_id = '{$member['mb_id']}'"; // 주문상태 취소를 제외,</p>
<p> $row = sql_fetch($sql);</p>
<p> $cart_price = $row['od_cart_price'];</p>
<p> if($cart_price >= 300000){</p>
<p> $level_up = 3;</p>
<p> }</p>
<p> $sql= " update {$g5['member_table']} set mb_level = '$level_up' where mb_id = '$mb_id' ";</p>
<p> sql_query($sql);</p>
<p> }</p>
<p><strong>
이상하게 첫 if문만 통과하고 중간에있는 if문은 그냥 넘어가버립니다 누적금액을 변수로 받아봐도 안돼는데.. 이거 왜이러는건가요 ..?
답변 2개
직접코드를 실행해보지 않아 우선 확인하실께
</strong></p>
<p>var_dump(<code>$cart_price</code>);</p>
<p><strong>
</strong> <code>if($mb_level['mb_level'] < 10){ $sql = "select sum(a.od_cart_price) od_cart_price from {$g5['g5_shop_order_table']} a inner join {$g5['member_table']} b on a.mb_id = b.mb_id where a.od_status = '완료' and a.mb_id = '{$member['mb_id']}'"; // 주문상태 취소를 제외, $row = sql_fetch($sql); $cart_price = $row['od_cart_price'];</code></pre> <p>var_dump(<code>$cart_price</code>);</p> <pre> <code> if($cart_price >= 300000){ $level_up = 3; } $sql= " update {$g5['member_table']} set mb_level = '$level_up' where mb_id = '$mb_id' "; sql_query($sql); }</code> <strong>
출력이 되는지 확인해보시고 다음단계로 진행해야 할것 같아요
--------------------------------------------------------------------------------------------------------------------
더 자세한 내용이 궁금하시면 여기 방문하세요
같이 얘기나누며 문제해결에 도움이 되도록 하세요
https://open.kakao.com/o/gzNuQjhe" rel="nofollow noreferrer noopener" target="_blank">https://open.kakao.com/o/gzNuQjhe
답변에 대한 댓글 1개
댓글을 작성하려면 로그인이 필요합니다.
답변을 작성하려면 로그인이 필요합니다.
로그인