【发布时间】:2014-03-01 17:58:03
【问题描述】:
解析错误:语法错误,第 25 行 StatusIG.php 中出现意外的 'if' (T_IF)
我在我的代码中确实没有发现任何问题,为什么会发生这种情况,请帮助。我是 PHP 初学者
我的第 25 行是 >> if($status == 0)
$accountdb_ip = "ip"; //Accountserver-IP $accountdb_login = "acc"; //Accountserver-登录名 $accountdb_pw = "psw"; //Accountserver-Password $db_ip = "ip"; //DB-服务器-IP $db_login = "acc"; //DB-Server-Loginname $db_pw = "psw"; //数据库-服务器-密码 $con = mysql_connect($db_ip, $db_login, $db_pw); $con_account = mysql_connect($accountdb_ip, $accountdb_login, $accountdb_pw); 如果 (!$con) { die('无法连接:' . mysql_error()); } $name = mysql_real_escape_string($_GET["name"], $con); $result_id = mysql_query("SELECT * FROM player.player WHERE name='".$name."' LIMIT 1", $con); $player_acc_id = mysql_result($result_id, 0, "account_id"); $result = mysql_query("SELECT * FROM account.account WHERE id='".$player_acc_id."'", $con); $status = mysql_result($result, 0, "raiguard") 如果($状态 == 0) {回声“0”;} 否则($状态 == 1) {回声“1”;} 否则($状态 == 2) {回声“2”;} mysql_close($con); mysql_close($con_account);【问题讨论】:
-
这个问题似乎离题了,因为它是关于基本语法错误的。
标签: php mysql if-statement syntax