When I enclose below script in a loop (
Code: Select all
like while (1 == 1){}Code: Select all
mysql_connect("localhost", "root", "new-password") or die("Couldnt connect");
mysql_select_db("profiles") or die("Couldnt select");
echo "excecuting ...";
$array = file("http://oh2aq.kolumbus.com/dxs/dx250.html?");
$last = mysql_query("SELECT `id`, `call` FROM `list` ORDER BY id DESC LIMIT 1") or die(mysql_error()."\nline 8");
$a = 1;
$count = count($array) - 2;
$test = mysql_result($last, 0, 'call');
while($test != $info[0]){
$info = preg_split("/ /", $array[$a], -1, PREG_SPLIT_NO_EMPTY);
$a++;
}
$b = 0;
$a = $a - 2;
while($a > $b ){
$info_2 = preg_split("/ /", $array[$a], -1, PREG_SPLIT_NO_EMPTY);
$comments = explode ("\n", chunk_split($array[$a], 30, "\n"));
$comment = str_replace("'", '"', $comments[1]);
echo $info_2[0]."|--|".$info_2[1]."|--|".$info_2[2]."|--|".$comment."|--|".$a."\n";
mysql_query("INSERT INTO `list` (`call`, `frequency`, `other_call`, `comments`) VALUES ('$info_2[0]', '$info_2[1]', '$info_2[2]', '$comment')") or die(mysql_error()."\nline 25");
$a--;
}
mysql_close();