Hi everybody,
I am experiencing a very strange UNDOCUMENTED phenomenon in a PHP script in RedHat 7.2 and IIS.
I make a very time consuming process, which consists of filling 1,000,000 rows in a MySql database. Instead of populating the database till the end of the task, it somehow re-starts, PROCESSES again the script (!!!!), and instantly RE-PROCESS IT again.
The result, it inserts around 200,000 lines, delete them, and insers around 700,000 and finally stops!!!!...
I call the script via HTTP through a web browser (IE 6) with
http://www.mydomain.com/my_script.php
I would appreciate any coment. Thanks in advance.
<script>alert('start')</script>
<?
set_time_limit(0);
global $REMOTE_ADDR;
// your data here
$host="";
$user="";
$password = "";
$db="";
// end of data
$server= mysql_connect($host,$user,$password);
mysql_select_db($db,$server);
$sql = "SELECT COUNT(*) as numero FROM cdint.ip_accesos";
$res = mysql_query($sql) or die(mysql_error());
$row = mysql_fetch_object($res);
if ($row->numero > 10000){
$sql = "DELETE FROM cdint.ip_accesos";
$res = mysql_query($sql) or die(mysql_error());
}else{
for($i=0;$i<1000000;++$i){
//echo $i . "<br>";
$sql = "INSERT INTO cdint.ip_accesos (ip,fecha) VALUES ('$REMOTE_ADDR', NOW())";
$res = mysql_query($sql) or die(mysql_error());
} // for
} // if
?>