sql 문 count 질문입니다. 정보
sql 문 count 질문입니다.본문
$sql="select count(*) as s from g4_coupon where mb_id='$roww[mb_id]' and cp_use='Y'";
$res=sql_fetch($sql);
$reco1=$res[s];
이렇게 해서 특정회원의 쿠폰중 cp_use='Y' 에 해당하는 수를 얻고 있습니다.
sql문을 추가하지 않고 sql 구문 하나로...
$sql="select count(*) as s from g4_coupon where mb_id='$roww[mb_id]'";
$sql="select count(*) as s from g4_coupon where mb_id='$roww[mb_id]' and cp_use='Y'";
이런 두가지 값을 모두 얻을려고 하면 어찌 해야 하나요?
$res=sql_fetch($sql);
$reco1=$res[s];
이렇게 해서 특정회원의 쿠폰중 cp_use='Y' 에 해당하는 수를 얻고 있습니다.
sql문을 추가하지 않고 sql 구문 하나로...
$sql="select count(*) as s from g4_coupon where mb_id='$roww[mb_id]'";
$sql="select count(*) as s from g4_coupon where mb_id='$roww[mb_id]' and cp_use='Y'";
이런 두가지 값을 모두 얻을려고 하면 어찌 해야 하나요?
댓글 전체
아...죄송합니다.
제가 질문내용을 잘못 전달한듯 합니다. ^^
답변 감사드립니다. 엑스엠엘님..^^
제가 질문내용을 잘못 전달한듯 합니다. ^^
답변 감사드립니다. 엑스엠엘님..^^