0

我遇到了一些问题。这是只返回空白页的查询(我已经尝试过在 php 等上报告错误):

$query = mysql_query(" SELECT player.id, player.level, character.name, 
                              character.owner, character.owner 
                       FROM player 
                       INNER JOIN character ON player.id = character.owner
                       WHERE character.world  = '$world' ");

$res= mysql_fetch_array($query) or die(mysql_error);
4

2 回答 2

3

之后你缺少括号mysql_error,你应该在调用之后调用它mysql_query

$sql = "SELECT ...";
$result = mysql_query($sql) or die(mysql_error());

如果查询失败,这应该显示错误消息。

有关如何mysql_query正确使用的更多详细信息,请参阅手册。

于 2012-10-26T11:50:41.313 回答
0
$query = mysql_query(" SELECT player.id, player.level, character.name, 
                          character.owner, character.owner 
                   FROM player 
                   INNER JOIN character ON player.id = character.owner
                   WHERE character.world  = '$world' ") or die(mysql_error());

$res= mysql_fetch_array($query);

如果您错过了某些内容,这将显示您的错误。

于 2012-10-26T12:18:37.007 回答