p

기간 설정

// 하루 ip 한번
$sql = "select * from $mw_inban[log_table] where mb_id = '$mb_id' and lg_ip = '$lg_ip' and lg_date = '$lg_date'";
$row = sql_fetch($sql);
if ($row)
    goto_url($mw_inban[ib_url]);

위 소소는 동일 ip는 하루에 한 번만 인정한다..이런건데요.
저기서 하루가 아닌 일주일, 한달, 일년 이렇게 바꾸려면 어떡해 고쳐야 하나요.

댓글 2개

맨 윗줄 맨끝에 $lg_date 를 상황에 맞게 $lg_month 또는 $lg_year 로 바꾸면 되지 않을까요?
(으흥.. 아니믄 으짜지 ㅠㅜ)
■ 일주일
$sql = "select * from $mw_inban[log_table] where mb_id = '$mb_id' and lg_ip = '$lg_ip' and lg_date between date_add('$lg_date', interval -7 day) and '$lg_date' ";

■ 한달
$sql = "select * from $mw_inban[log_table] where mb_id = '$mb_id' and lg_ip = '$lg_ip' and lg_date between date_add('$lg_date', interval -1 month) and '$lg_date' ";

■ 일년
$sql = "select * from $mw_inban[log_table] where mb_id = '$mb_id' and lg_ip = '$lg_ip' and lg_date between date_add('$lg_date', interval -1 year) and '$lg_date' ";
댓글을 작성하시려면 로그인이 필요합니다.

그누보드4 관련 질문은 QA 로 이전됩니다. QA 그누보드4 바로가기 기존 게시물은 열람만 가능합니다.

+
제목 글쓴이 날짜 조회
10-01-23 조회 1,623
10-01-23 조회 1,509
10-01-23 조회 1,116
10-01-23 조회 3,102
10-01-23 조회 1,343
10-01-23 조회 1,874
10-01-23 조회 1,381
10-01-23 조회 1,760
10-01-23 조회 1,665
10-01-23 조회 1,672
10-01-23 조회 1,621
10-01-23 조회 1,629
10-01-23 조회 4,045
10-01-23 조회 1,416
10-01-23 조회 1,744
10-01-22 조회 1,095
10-01-22 조회 2,318
10-01-22 조회 1,651
10-01-22 조회 1,606
10-01-22 조회 3,309