1
I need to update only records that are expired and add a tolerance of x days
Example
Tolerance of 5 days
Today is = 11/10/2016
id= 1 maturity = 10/10/2016 // only update if today was day 15
id= 2 maturity = 06/10/2016 // perform update
id= 3 maturity = 10/10/2016 // only update if today was day 15
id= 4 maturity = 10/10/2016 // only update if today was day 15
Here’s my code but it’s not working right to rule
$query = mysql_query("UPDATE finan SET status='Vencido' WHERE status = 'Em Aberto' AND vencimento < CURDATE() + INTERVAL '$tolerencia' DAY ") or die(mysql_error());