I have form of uploading data to the database, but I need to delete data after 1 month. how does it possibe.
here is my query of insert data to the database:
$sql = "INSERT INTO sales_order (ProductType,WorkOrder,POIssueDate,SalesMonth)
ON DUPLICATE KEY UPDATE
ProductType = '$ProductType', WorkOrder = '$WorkOrder', POIssueDate = '$POIssueDate', SalesMonth = '$SalesMonth'" or die(mysql_error());
Should I need to add fields for date upload?
If you can add new field date_created, then it will be easy for you to delete the data after 1 month.
Or use POIssueDate, here is sample query to delete the records older than a month.
delete from sales_order where POIssueDate <= date_sub(curdate(), interval 1 month)