Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- $con = mysql_connect("localhost","root","");
- mysql_select_db('dota2stats',$con);
- $url = "http://api.steampowered.com/IDOTA2Match_570/GetMatchHistory/V001/?key=6B10D3DA795C15E938753C329C86C259&account_id=STEAM_0:1:14224878";
- $json = file_get_contents($url);
- $data = json_decode($json);
- foreach($data->result->matches as $value) {
- if($value) {
- mysql_query("INSERT INTO evol (match_id,
- date,
- hero_id,
- game_won
- )
- VALUES ($value->match_id,
- $value->start_time,
- 0,
- 0
- )"
- );
- foreach($data->result->matches->players as $value2) {
- if (account_id == "28449757") {
- mysql_query("INSERT INTO evol (hero_id) VALUES ($value2->hero_id)");
- }
- }
- }
- }
- mysql_close($con);
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement