Hello you all. I am trying to find or code( never written a php function before, manage to get by without it) a function that does the following:
run a process by means of a loop based on how many records in a database. Now the process may run for more that 30 seconds due to the size of the database, how do i get the function to check the time and continue with the process after 30 seconds until the database reocrds are processed and dont have the page time out.
for example this simple script does what i want but it only works based on the server time of 30 seconds:
/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////if(isset($_SESSION['randomUserId']))
{
$rsstalecartitems = "SELECT ter_orderlist_ord.id_ord
FROM ter_proddet_prd where ter_history_his.ip_his = '12345' ";
$rsstalecartitems_result = mysql_query($rsstalecartitems,$ksConnection) or die(mysql_error());
$num_rows = mysql_num_rows($rsstalecartitems_result);
//echo $num_rows;
if($num_rows != ""){
$i=0;
while ($row_rsstalecartitems=mysql_fetch_assoc($rsstalec artitems_result)){
$addedby = $row_rsstalecartitems['idusr_ord'];
$i++;
$deletecartinfo = "delete from ter_orderlist_ord where idusr_ord='$addedby'";
$deletecartinfo_result = mysql_query($deletecartinfo,$ksConnection) or die(mysql_error());
$deleteuserinfo = "delete from ter_user_usr where id_usr='$addedby'";
$deleteuserinfo_result = mysql_query($deleteuserinfo,$ksConnection) or die(mysql_error());
}
}
Any Help is appreciated.