I want to create a PHP script that runs automaticly every day at a specific time that deletes data from a specific column in a database. How would I do this? I know how to delete data from a column but I do not know how to make the script run on the server automaticly. Also how would I select all the rows from a database where 'name' == 'bob' and order that data by increasing 'date' where the 'date' is passed through a MySQL command (DATE_FORMAT)? Thanks!
Or integrate it into your webpage using a require(); that require a php that run a function everytime someone visit, check for the datetime (put it a range of date time, and it's applicable for large site only), prefer the cronjob. Also another way is to use a long running script that can still run and sleep even if you closed the page (dangerous though) Use the cronjob on your webhost manager, everyone have that.