不工作我有一個問題,我的代碼否則在PHP
$save = mysql_real_escape_string($_POST['save']);
$query1 = "SELECT * from users WHERE user_id=".$_SESSION['user'];
$result = mysql_query($query1);
while($row = mysql_fetch_array($result)) {
// Get money from column
$money = $row['money'];
if($money >= $save)
$query1 = "UPDATE users SET savings = savings + $save, money = money - $save WHERE user_id=".$_SESSION['user'];
$update1 = mysqli_query($conn,$query1); // call 1st query
echo 'Money transferred successfully!!!';
} else {
echo 'U NO MONEY IN CHECKING!!!!';
}
?>
else語句不工作,我得到這個錯誤:
Parse error: syntax error, unexpected 'else' (T_ELSE) in C:\wamp\www\bank.php on line 44
'如果($錢> = $保存)'應該是'if($ money> = $ save){' –
@TheCodesee它仍然不工作 –