DB에서 레벨 변경 후 다시 초기화 현상

DB에서 레벨 변경 후 다시 초기화 현상

QA

DB에서 레벨 변경 후 다시 초기화 현상

본문

최고관리자 계정이 레벨 2가 계속 유지되네요 DB에서 변경을해도..

 

extend파일에서
 

<?php
if (!defined('_GNUBOARD_')) exit; // 개별 페이지 접근 불가

// 회원 레벨 체크
if ($member['mb_id']) {
    $rowMs=sql_fetch("select sum(po_point) sPoint from ".$g5['point_table']." where mb_id='".$member['mb_id']."' And po_point>0");
    $sPoint=$rowMs['sPoint'];
    
    if ($sPoint<1500) $cLevel=2;
    else if ($sPoint>=1500 && $sPoint<3000) $cLevel=3;
    else if ($sPoint>=3000 && $sPoint<5000) $cLevel=4;
    else if ($sPoint>=5000 && $sPoint<10000) $cLevel=5;
    else if ($sPoint>=10000 && $sPoint<20000) $cLevel=6;
    else if ($sPoint>=20000 && $sPoint<30000) $cLevel=7;
    else if ($sPoint>=30000 && $sPoint<40000) $cLevel=8;
    else if ($sPoint>=40000 && $sPoint<80000) $cLevel=9;
    else if ($sPoint>=80000 && $sPoint<100000) $cLevel=10;
    else if ($sPoint>=100000 && $sPoint<130000) $cLevel=11;
    else if ($sPoint>=130000 && $sPoint<180000) $cLevel=12;
    else if ($sPoint>=180000 && $sPoint<230000) $cLevel=13;
    else if ($sPoint>=230000 && $sPoint<300000) $cLevel=14;
    else if ($sPoint>=300000 && $sPoint<500000) $cLevel=15;
    else if ($sPoint>=500000 && $sPoint<600000) $cLevel=16;
    else if ($sPoint>=600000 && $sPoint<800000) $cLevel=17;
    else if ($sPoint>=800000 && $sPoint<1200000) $cLevel=18;
    else if ($sPoint>=1200000 && $sPoint<1600000) $cLevel=19;
    else if ($sPoint>=1600000 && $sPoint<2000000) $cLevel=20;
    else if ($sPoint>=2000000 && $sPoint<2500000) $cLevel=21;
    else if ($sPoint>=2500000 && $sPoint<3000000) $cLevel=22;
    else if ($sPoint>=3000000 && $sPoint<3500000) $cLevel=23;
    else if ($sPoint>=3500000 && $sPoint<4000000) $cLevel=24;
    else if ($sPoint>=4000000 && $sPoint<4500000) $cLevel=25;
    else if ($sPoint>=4500000 && $sPoint<5000000) $cLevel=26;
    else if ($sPoint>=5000000 && $sPoint<5500000) $cLevel=27;
    else if ($sPoint>=5500000) $cLevel=28;

    sql_query("update ".$g5['member_table']." set mb_level='". $cLevel ."' where mb_id='".$member['mb_id']."' And mb_level<=25 ");
}
?>

 

를 추가하였는데 무슨 문제가 있을까요 ? ㅠ

이 질문에 댓글 쓰기 :

답변 3

생각해보니까 지금 회원 레벨이 하고 줘야되는 레벨 하고 비교되는 조건문 이 없는것같아요

<?php
if (!defined('_GNUBOARD_')) exit; // 개별 페이지 접근 불가



// 최고관리자
sql_query(" update {$g5['member_table']} set mb_level = '10' where mb_id = 'admin' ");



// 회원 레벨 체크
if ($member['mb_id']) {
$rowMs=sql_fetch("select sum(po_point) sPoint from ".$g5['point_table']." where mb_id='".$member['mb_id']."' And po_point>0");
$sPoint=$rowMs['sPoint'];

if ($sPoint<1500) $cLevel=2;
else if ($sPoint>=1500 && $sPoint<3000) $cLevel=3;
else if ($sPoint>=3000 && $sPoint<5000) $cLevel=4;
else if ($sPoint>=5000 && $sPoint<10000) $cLevel=5;
else if ($sPoint>=10000 && $sPoint<20000) $cLevel=6;
else if ($sPoint>=20000 && $sPoint<30000) $cLevel=7;
else if ($sPoint>=30000 && $sPoint<40000) $cLevel=8;
else if ($sPoint>=40000 && $sPoint<80000) $cLevel=9;
else if ($sPoint>=80000 && $sPoint<100000) $cLevel=10;
else if ($sPoint>=100000 && $sPoint<130000) $cLevel=11;
else if ($sPoint>=130000 && $sPoint<180000) $cLevel=12;
else if ($sPoint>=180000 && $sPoint<230000) $cLevel=13;
else if ($sPoint>=230000 && $sPoint<300000) $cLevel=14;
else if ($sPoint>=300000 && $sPoint<500000) $cLevel=15;
else if ($sPoint>=500000 && $sPoint<600000) $cLevel=16;
else if ($sPoint>=600000 && $sPoint<800000) $cLevel=17;
else if ($sPoint>=800000 && $sPoint<1200000) $cLevel=18;
else if ($sPoint>=1200000 && $sPoint<1600000) $cLevel=19;
else if ($sPoint>=1600000 && $sPoint<2000000) $cLevel=20;
else if ($sPoint>=2000000 && $sPoint<2500000) $cLevel=21;
else if ($sPoint>=2500000 && $sPoint<3000000) $cLevel=22;
else if ($sPoint>=3000000 && $sPoint<3500000) $cLevel=23;
else if ($sPoint>=3500000 && $sPoint<4000000) $cLevel=24;
else if ($sPoint>=4000000 && $sPoint<4500000) $cLevel=25;
else if ($sPoint>=4500000 && $sPoint<5000000) $cLevel=26;
else if ($sPoint>=5000000 && $sPoint<5500000) $cLevel=27;
else if ($sPoint>=5500000) $cLevel=28;

sql_query("update ".$g5['member_table']." set mb_level='". $cLevel ."' where mb_id='".$member['mb_id']."' And mb_level<=25 ");
}
?>

답변 감사합니다.
이렇게 말씀이신건가요 ~?

$sPoint=$rowMs['sPoint'];

이 뒤에서

 

echo $sPoint; exit;를 찍어보시고

숫자로 보려지고 값이 1500보다 큰데도 안되는경우

$sPoint=(int)$rowMs['sPoint'];

로 변경후 해보세요

답변을 작성하시기 전에 로그인 해주세요.
전체 31
QA 내용 검색

회원로그인

(주)에스아이알소프트 / 대표:홍석명 / (06211) 서울특별시 강남구 역삼동 707-34 한신인터밸리24 서관 1404호 / E-Mail: admin@sir.kr
사업자등록번호: 217-81-36347 / 통신판매업신고번호:2014-서울강남-02098호 / 개인정보보호책임자:김민섭(minsup@sir.kr)
© SIRSOFT