테스트 사이트 - 개발 중인 베타 버전입니다

자동 래밸 질문입니다. 채택완료

코니팡 5년 전 조회 2,177

</p>

<pre style="color: rgb(0, 0, 0); font-family: "굴림체"; font-size: 9pt; background-color: rgb(255, 255, 255);">
<span style="color: rgb(0, 0, 128); font-weight: bold; background-color: rgb(247, 250, 255);">if </span><span style="background-color: rgb(247, 250, 255);">(</span><span style="color: rgb(102, 0, 0); background-color: rgb(247, 250, 255);">$w </span><span style="background-color: rgb(247, 250, 255);">==</span><span style="color: rgb(0, 128, 0); font-weight: bold; background-color: rgb(247, 250, 255);">'' </span><span style="background-color: rgb(247, 250, 255);">&& </span><span style="color: rgb(102, 0, 0); background-color: rgb(247, 250, 255);">$member</span><span style="background-color: rgb(247, 250, 255);">[</span><span style="color: rgb(0, 128, 0); font-weight: bold; background-color: rgb(247, 250, 255);">'mb_id'</span><span style="background-color: rgb(247, 250, 255);">] && </span><span style="color: rgb(102, 0, 0); background-color: rgb(247, 250, 255);">$member</span><span style="background-color: rgb(247, 250, 255);">[</span><span style="color: rgb(0, 128, 0); font-weight: bold; background-color: rgb(247, 250, 255);">'mb_level'</span><span style="background-color: rgb(247, 250, 255);">] < </span><span style="color: rgb(102, 0, 0); background-color: rgb(247, 250, 255);">$board</span><span style="background-color: rgb(247, 250, 255);">[</span><span style="color: rgb(0, 128, 0); font-weight: bold; background-color: rgb(247, 250, 255);">'bo_1'</span><span style="background-color: rgb(247, 250, 255);">]) {
</span><span style="background-color: rgb(247, 250, 255);">    sql_query(</span><span style="color: rgb(0, 128, 0); font-weight: bold; background-color: rgb(247, 250, 255);">" update </span><span style="background-color: rgb(247, 250, 255);">{</span><span style="color: rgb(102, 0, 0); background-color: rgb(247, 250, 255);">$g5</span><span style="background-color: rgb(247, 250, 255);">[</span><span style="color: rgb(0, 128, 0); font-weight: bold; background-color: rgb(247, 250, 255);">'member_table'</span><span style="background-color: rgb(247, 250, 255);">]}</span><span style="color: rgb(0, 128, 0); font-weight: bold; background-color: rgb(247, 250, 255);"> set mb_level = '</span><span style="background-color: rgb(247, 250, 255);">{</span><span style="color: rgb(102, 0, 0); background-color: rgb(247, 250, 255);">$board</span><span style="background-color: rgb(247, 250, 255);">[</span><span style="color: rgb(0, 128, 0); font-weight: bold; background-color: rgb(247, 250, 255);">'bo_1'</span><span style="background-color: rgb(247, 250, 255);">]}</span><span style="color: rgb(0, 128, 0); font-weight: bold; background-color: rgb(247, 250, 255);">' where mb_id = '</span><span style="background-color: rgb(247, 250, 255);">{</span><span style="color: rgb(102, 0, 0); background-color: rgb(247, 250, 255);">$member</span><span style="background-color: rgb(247, 250, 255);">[</span><span style="color: rgb(0, 128, 0); font-weight: bold; background-color: rgb(247, 250, 255);">'mb_id'</span><span style="background-color: rgb(247, 250, 255);">]}</span><span style="color: rgb(0, 128, 0); font-weight: bold; background-color: rgb(247, 250, 255);">' "</span><span style="background-color: rgb(247, 250, 255);">);</span></pre>

<p><span style="background-color: rgb(247, 250, 255);">

 

안녕하세요 ㅠㅠ

햇갈려서요~

 

bo_1 = 5

 

누구든 5로 변환시키고 싶은데요.

 

5보다 낮은 2,3,4 경우에만 5로 변화더라구요

 

6 또는 7인 경우에도

5로 변환 시키고 싶은데

어떻게해야하나요?~!ㅠㅜㅠ

 

 

 

 

댓글을 작성하려면 로그인이 필요합니다.

답변 1개

채택된 답변
+20 포인트
ifelse
5년 전

 

작성하신 if문 조건

$w == '' <-  글을 새로 작성할때  

&& 는 그리고

$member['mb_id'] <- 회원일때

&& 는 그리고

$member['mb_level'] < $board['bo_1'] 회원레벨이 bo_1 값보다 작을때..

멤버의 레벨이 5이하일때만 쿼리가 돌겠금 if문이 작성되어있습니다.

즉 $member['mb_level'] < $board['bo_1'] 때문이져..

 

그리고 혹 어드민 아이디도 글썼다가..레벨이 바뀔수 있으니

$member['mb_level'] < $board['bo_1'] 는 빼시고

!$is_admin 어드민이 아닐때를 넣어주시면 좋을것 같습니다.

 

</p>

<pre>
if ($w =='' && $member['mb_id'] &&<span style="color:#e74c3c;"><strong> !$is_admin</strong></span>) {
    sql_query(" update {$g5['member_table']} set mb_level = '{$board['bo_1']}' where mb_id = '{$member['mb_id']}' ");
</pre>

<p>

로그인 후 평가할 수 있습니다

댓글을 작성하려면 로그인이 필요합니다.

답변을 작성하려면 로그인이 필요합니다.

로그인