My table, tracking_orders
, has a column named order_time
. When a new row is made, data is created like so to be put into that column:
$order_time= date('F j, Y');
When I insert a new row, I use the code:
$sql = "insert into tracking_orders (order_time) values ('".$order_time."')";
Today, if I used that query the data for that column would read: April 8, 2014
I am trying to make a delete query to find any rows in the table that is older than 1 year, and then delete them. So if I made a row last year on this same day, April 8, then it would be deleted. If the order_time
column data was April 9, 2013, then it would be left alone.
All help is greatly appreciated.