我遇到了一些问题。这是只返回空白页面的查询(我在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);
答案 0 :(得分:3)
mysql_error
后你遗漏了括号,你应该在致电mysql_query
后给它打电话:
$sql = "SELECT ...";
$result = mysql_query($sql) or die(mysql_error());
如果查询失败,则应显示错误消息。
有关如何正确使用mysql_query
的更多详细信息,请参阅手册。
答案 1 :(得分: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);
如果您错过了某些内容,这将显示您的错误。