我有下面的代碼,當我加載它,我總是得到這個錯誤..語法錯誤,意外 ':'
function newPlayer($wallet) {
generate_: {
$hash=generateHash(32);
}
if (mysql_num_rows(mysql_query("SELECT `id` FROM `players` WHERE `hash`='$hash' LIMIT 1"))!=0) goto generate_;
$alias='Player_';
$alias_i=mysql_fetch_array(mysql_query("SELECT `autoalias_increment` AS `data` FROM `system` LIMIT 1"));
$alias_i=$alias_i['data'];
mysql_query("UPDATE `system` SET `autoalias_increment`=`autoalias_increment`+1 LIMIT 1");
mysql_query("INSERT INTO `players` (`hash`,`alias`,`time_last_active`,`server_seed`) VALUES ('$hash','".$alias.$alias_i."',NOW(),'".generateServerSeed()."')");
header('Location: ./?unique='.$hash.'# Do Not Share This URL!');
exit();
}
錯誤:
Parse error: syntax error, unexpected ':' in /home/a1180044/public_html/inc/functions.php on line 49
49號線是generate_:
PHP JavaScript不 – PeeHaa
什麼'generate_的作用:'? – Cristik
你是否在任何一個古老的PHP版本? – PeeHaa