if 조건문 관련 문의 채택완료

제가 뭘 놓치고 있는게 있나요?

echo $bo_table;
echo "<br>";
 if ($bo_table = "music" or $bo_table = "youtube" or $bo_table = "gallery") {$wrnone = "";} else {$wrnone = "class=plushidden   style=display:none;float:left;margin-right:5px;";}
echo $bo_table;
 

테이블에 따라서 스타일을 다르게 적용하려고 했는데 안되서..

script라는 테이블 목록(list_skin) 상단에서 위와 같이 조건문 걸고 출력해봤더니,

script

music 

이렇게 출력되네요.

script

script 

이렇게 출력되야 하는 거 아닌가요?

답변 1개

채택된 답변
+20 포인트

if 구문의 equal comparison 은 == 로 표현합니다.

https://www.php.net/manual/en/language.operators.comparison.php

Copy
// if ($bo_table = "music" or $bo_table = "youtube" or $bo_table = "gallery")

 if ($bo_table == "music" or $bo_table == "youtube" or $bo_table == "gallery")
로그인 후 평가할 수 있습니다

답변에 대한 댓글 1개

아~ 감사합니다. 더위 먹었나봐요;;;;;;;;;

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

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

로그인
🐛 버그신고