parent
b139aebb4b
commit
a23b8504c6
1 changed files with 24 additions and 0 deletions
@ -0,0 +1,24 @@ |
|||||||
|
<?php |
||||||
|
|
||||||
|
require_once __DIR__."/../util/mysql_connect.php"; |
||||||
|
require_once __DIR__."/RiotRequest.php"; |
||||||
|
|
||||||
|
$conn = new MySQLConnection(); |
||||||
|
|
||||||
|
$accounts = $conn->query("SELECT * FROM accounts")->fetch_all(MYSQLI_ASSOC); |
||||||
|
|
||||||
|
foreach ($accounts as $currentAccount) { |
||||||
|
$gameName = $currentAccount["gameName"]; |
||||||
|
$tagLine = $currentAccount["tagLine"]; |
||||||
|
$request = new RiotRequest("riot/account/v1/accounts/by-riot-id/$gameName/$tagLine"); |
||||||
|
$request->useRouting(); |
||||||
|
$fetchedAccount = $request->run(); |
||||||
|
|
||||||
|
if ($request->responseCode === 200){ |
||||||
|
$conn->prepare(" |
||||||
|
UPDATE accounts |
||||||
|
SET puuid = ? |
||||||
|
WHERE puuid = ? |
||||||
|
")->execute([$fetchedAccount->puuid, $currentAccount["puuid"]]); |
||||||
|
} |
||||||
|
} |
Loading…
Reference in new issue