10/10/2018, 11:05
Lỗi switch và while trong PHP
Code:
<?php } switch ($p)
{
default : while ($row_baihat = mysql_fetch_assoc($baihat));
}
?>
Parse error: syntax error, unexpected T_SWITCH, expecting T_WHILE
Bài liên quan





bạn tử sủa lại là
default : while ($row_baihat = mysql_fetch_assoc($baihat)){ //làm cái gì đó }switch($p){ case '1': /** làm việc 1 */ break; case '2': /** làm việc 2*/ break; // vân vân. // nếu không có thì làm việc mặc đinh. default: /* làm cái mặc đinh */ }<?php $theloai; $theloai2; switch ($p) { case "2": $theloai = $row_NhacHoa; $theloai2 = $NhacHoa; break; default: $theloai = $row_baihat; $theloai2 = $baihat; } ?> <?php } while ($theloai = mysql_fetch_assoc($theloai2)); ?>