newphpcoder Posted April 13, 2012 Report Share Posted April 13, 2012 Hi...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) VALUES ('$ProductType','$WorkOrder','$POIssueDate','$SalesMonth') ON DUPLICATE KEY UPDATE ProductType = '$ProductType', WorkOrder = '$WorkOrder', POIssueDate = '$POIssueDate', SalesMonth = '$SalesMonth'" or die(mysql_error()); mysql_query($sql, $con); Should I need to add fields for date upload?Thank you Link to comment Share on other sites More sharing options...
astralaaron Posted April 13, 2012 Report Share Posted April 13, 2012 how are you storing your date? you just need to add to your WHERE clause of a DELETE statement the date some how incremented by 30 days Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now