I want to keep track the status if there is no shipment of product within 2 days then there is must have a notification to alert them by email to do a shipment. The shipment date can be fetch from email date but it is possible if I compare :
//MAX(date_shipment = latest date record of shipment in database
if (MAX(date_shipment) - dateNow() >= 2 days )
{
$update ="update table1 set remarks = 'No shipment received since 2 days ago', status = 'warning'";
$result = mysql_query($update);
}
else
{ }
But there is problem I thinks because this code is compare with dateNow(). How come if there is new shipment received, still the date comparison code running but not compare with this new shipment date received. I have no idea how to explain and how to start to do this function.
Can someone advise what is the right way to solve this prob? Thanks in advance
if (MAX(date_shipment) - dateNow() >= 2 days )this won't parse in PHP. Yourupdate table1 set remarks = 'No shipment received since 2 days ago', status = 'warning'query will update every row of your table since you didn't specify aWHEREclause.date_shipmentshould be$date_shipment? Is this a date element from the database?