Hi guys,
Im making a script to prune my table which currently holds a log of all bookings ever made.
I am trying to make a script that will delete all entries older than a certain number of days old,
say, $numberofDays = 60.
This is where im stuck. I have little idea how to go about this. I can confirm that my table stores
the date as yyyy-mm-dd format.
I was thinking somewhere along the lines of...
$aDate = date('Y-m-d', strtotime("-".$numberofDays." days"))
$sql="DELETE FROM bookings WHERE dateofbooking < aDate";
Does that make sense, surely not? Newbie here, so be gentle 🙂
Any help would be much appreciated. Thank you.