하루 발송 제한 거는 방법좀 알려주세요
본문
코멘트 포인트 발송 입니다.
1일 제한 5회를 걸고 싶어요
point_table
포인트 테이블에 저장되는 발송인 4444입니다.
오늘 5회 이상 발송 금지
po_rel_action과 계정이 같고 po_rel_table 이 1과 같을시
po_expire_date=오늘
5번이 넘어가면 안되게 하고 싶어요
insert_point($wr['mb_id'], $w_point,
"{$comment_id}코멘트 보상.", $bo_table, $wr_id, $wr['mb_id'].'수취');
insert_point($member['mb_id'], $ww_point,
"{$comment_id}코멘트 지급.", 1, $wr_id, $member['mb_id']);
답변 1
<?php
$sql = "
select count(*) as cnt
from g5_point
where mb_id = '{$member['mb_id']}'
and date(po_datetime) = curdate()
and mb_id = po_rel_action
";
$row = sql_fetch($sql);
if ($row['cnt'] >= 5)
alert('1일 5회까지만 가능합니다.');
?>
답변을 작성하시기 전에 로그인 해주세요.