您好,我試圖做一些隨機數並做一個簡單的mysql更新,但由於某種原因,Dreamweaver在右括號中顯示錯誤。如果在結束方括號中顯示錯誤
<?php
if (isset($_POST['battle_move'])) {
$battle_move= mysql_real_escape_string($_POST['battle_move']);
$battle_move22 = strip_tags($battle_move);
$random_number = rand(1, 50);
$a = $random_number ;
$b = 5;
$random_number1 = ($a * $b) ;
$random_number2 = rand(1, 50);
$c = $random_number2 ;
$d = 5;
$random_number22 = ($c * $d) ;
mysql_query("UPDATE maplog SET wildpokemonhp=wildpokemonhp+".$random_number1." WHERE username = '".$_SESSION['username']."'")
mysql_query("UPDATE maplog SET userpokemonhp=userpokemonhp+".$random_number22." WHERE username = '".$_SESSION['username']."'")
}
?>
我將它上傳到我的服務器並獲得一個白頁。我從來沒有遇到過這是爲...它說最後}是問題.....
您錯過了兩個mysql_query ...語句末尾的分號。 – Prabhuram 2012-04-18 10:56:25