I have an edit page.
I made a button on edit page. It needs to delay the due date (son_tarih is due date) of work 1 month later.
It has an error. For example if "son_tarih" is 01.01.2020 its loading page for a while and nothing happens. So when i check it again by refreshing. Due date (son_tarih) is 01.05.3863. Code runs like 50000 times. And bcuz of it it doesnt return back to list page also.
Server:
while($record = $button->getCurrentRecord())
{
$ID = $record["ID"];
$sontarih = $record["son_tarih"];
$ertelemetarihi = date('Y-m-d', strtotime($sontarih. ' + 1 month'));
$sql = "UPDATE is_takip_new SET son_tarih='$ertelemetarihi' where ID=".$ID;
DB::Exec($sql);
}
Client After:
location.href="is_takip_new_list.php?a=return";
Can you help me? I need it to run once and make 01.01.2020 to 01.02.2020 and return to list page.