%PDF- %PDF-
Direktori : /data/www_bck/varak.net_bck/wow2.varak.net/xml/ |
Current File : //data/www_bck/varak.net_bck/wow2.varak.net/xml/xml.php |
<?php include("../lib.php"); $tzac=getmicrotime(); header("Content-type: text/plain"); $res = simplexml_load_file("waritko_submissions.xml"); $spojeni = mysql_connect("localhost", "waritko", "blade666"); mysql_select_db("waritko_eqdkp", $spojeni); foreach($res->item as $item) { $artist = str_replace("'", "''", $item->artist); $album = str_replace("'", "''", $item->album); $track = str_replace("'", "''", $item->track); $time = $item->timestamp; $duration = $item->duration; q("insert into played(artist, album, track, time, duration) values('$artist', '$album', '$track', $time, $duration);"); $count++; //echo $que; } mysql_close($spojeni); unlink("waritko_submissions.xml"); $mem = sprintf("%01.2f", memory_get_peak_usage(true)/(1024*2024)); $tkon=getmicrotime(); $time=$tkon-$tzac; $time = sprintf("%01.4f", $time); echo "Hotovo, importovano $count prehranych pisnicek\nImport trval $time sekund, bylo pouzito $mem MB pameti\n"; ?>