我正在尝试为我的 MySQL 数据库中的多个 SteamID 生成一个 HTML 表。我的数据库如下所示:
id | steamid64 | xenforo_username | xenforo_userid
/*
* Accountlist Query
*/
$list = $db->query('SELECT * FROM steamlist ORDER BY id DESC');
$list = $list->fetch_assoc();
/*
* Parse Query Values into Strings
*/
$steamid = $list['steamid64'];
$xfUsername = $list['xf_username'];
$xfUserid = $list['xf_userid'];
/*
* Create array for the list
*/
$steamlist = array( array("Forum Username | "=>$xfUsername, "Steam Username | "=>$steamapi->personaname, "SteamID | "=>$steamid, "Last Logout | "=>$steamapi->lastlogoff, "Onlinestatus"=>$steamapi->personastate)
);
/*
* API URL
*/
$api_url=file_get_contents("https://api.steampowered.com/ISteamUser/GetPlayerSummaries/v2/?key=$api_key&format=json&steamids=$steamid");
$api_url = json_decode($api_url);
/*
* Parse API URL into variable
*/
$steamapi = $api_url->response->players[0];
我相信我需要一个 foreach 函数来从 SteamAPI 获取存储在我的数据库中的所有 SteamID 的信息。有人可以帮我吗?