Warning: simplexml_load_file(http://clodogame.fr/dev/api/user.70%0D%0A.xml) [function.simplexml-load-file]: failed to open stream: HTTP request failed! HTTP/1.1 500 Internal Server Error in C:\Strony\sql.php on line 15 Warning: simplexml_load_file() [function.simplexml-load-file]: I/O warning : failed to load external entity "http://clodogame.fr/dev/api/user.70%0D%0A.xml" in C:\Strony\sql.php on line 15 Nie mozna przeniesc gracza ! Table 'myhighscore.gracze' doesn't exist
Skrypt wygląda tak:
<? $sql['server'] = "db4free.net:3306"; $sql['username'] = "trecco"; $sql['password'] = "********"; $sql['database'] = "myhighscore"; mysql_connect($sql['server'],$sql['username'],$sql['password']) or die("Nie mozna polaczyc sie z serwerem! Blad: ".mysql_error()); foreach($plik as $p) { $xml = simplexml_load_file("http://clodogame.fr/dev/api/user.".$p.".xml"); $id = $xml['id']; $name = $xml['name']; $points = $xml['points']; $position = $xml['position']; $gangname = $xml->gang['name']; $query = mysql_query("INSERT INTO `gracze` (`id`,`name`,`points`,`position`,`gangname`) VALUES('NULL','$id','$name','$points','$position','$gangname')") or die("Nie mozna przeniesc gracza $name! ".mysql_error()); } ?>
Plik tekstowy:
70 117 97 89 575 28 95 528 489 263 130 568 96 645 341 608 262 42 381 91
Strasznie byłbym wdzięczny za pomoc.