我有一個if else語句,但它不能正常工作。當我添加它時,即使數據庫信息與if語句中的=
不匹配,它也只會迴應第一條語句,我做錯了什麼?Php如果其他人不工作
$gameum = $db->fetch("SELECT * FROM accounts WHERE `id` = '$id'");
$status = $gameum['status'];
$gameid = $gameum['gameid'];
$search = $gameum['seraching_for'];
if($gameum['status'] = '0') {
$data ='<h1> Who do you want to battle against? </h1><br />
<form action="" method="post" id="form-pb" name="pb" target="_self" >
USERNAME:<input name="name" type="text" size="40" maxlength="40" />
<input name="submit" type="submit" value="Search"/>
</form>
<a class="goback" href="#">Cancel</a>';
} else {
$data = '<h1> Searching </h1> <br /> Searching for '.$search.'';
}
截圖數據庫行:
'='是賦值運算符,'=='用於比較。 – mario