mysql insert suddenly stops working in my php code -
insert working in phpmyadmin can't figure out why stopped working in php code. table has 2 columns, 1 auto incremented other value effort insert. when table hits 99760 entries inserts php script have no effect, it's possible insert values phpmyadmin. recent summoner_id entered 410893 , here link image of table construction window: http://puu.sh/9kkua/35cfcae788.png
<?php $con=mysqli_connect("localhost", "root", "pass", "stats"); if (mysqli_connect_errno()) { echo "failed connect mysql: " . mysqli_connect_error(); } $position = $_get["count"]; $ids = strval($position); for($i = $position + 1; $i < $position + 40; $i++) { $ids = $ids . "," . strval($i); } { sleep(1); $raw = file_get_contents('https://euw.api.pvp.net/api/lol/euw/v1.4/summoner/' . $ids . '?api_key=****'); }while(strcmp($http_response_header[0], 'http/1.1 429 429') == 0); if(strcmp($http_response_header[0], 'http/1.1 404 not found') == 0) { return; } $data = json_decode($raw, true); foreach($data &$summoner) { if($summoner["summonerlevel"] == 30) { $sql="insert `active_summoners`(`summoner_id`) values (" . $summoner["id"] . ")"; if (!mysqli_query($con,$sql)) { echo "error: " . mysqli_error($con); } } } ?>
i think should increment php execution size:
ini_set('max_execution_time', 0); then work fine.
php mysql sql
No comments:
Post a Comment