Echo是重复的

时间:2014-08-21 18:06:36

标签: php mysql

我正在尝试使用&#34来回显数据库中的值;如果"但回声重复。

<?php   
include ('config2.php');
$result = mysql_query("select * from accounts");

while($row = mysql_fetch_array($result)) {
    $banned = $row['banned'];
    $banned_by = $row['banned_by'];
    $banned_reason = $row['banned_reason'];

If ($banned = 10)
echo "Banned";
else {
echo "Active";
}
}
?>

1 个答案:

答案 0 :(得分:3)

你的代码错了。试试

if($banned == 10)