我的数组仅显示第一个结果。经过一些研究后,看来我需要包括一些时间,但是当我尝试进行此操作时,问题仍然相同。
$result = mysql_query("SELECT * FROM `Hitman_contracts` ")
or die("Get data connect to database failled!");
$row = mysql_fetch_array($result);
$id = $row['PLAYER_CONTRACT_ID'];
$bounty = $row['EXECUTION_PRICE'];
$data = mysql_query("SELECT * FROM `PlayerData` WHERE ID = '$id' ")
or die("Get data connect to database failled!");
$playerdata = mysql_fetch_array($data);
$playername = $playerdata['PLAYER_NAME'];
echo $playername ;
echo $bounty ;
正如我所说,它一次可以正常工作。