Ok, I thought I had solved my problem but it looks like I am going the wrong way about this and don't know if I need a cron job or not.
On my site when an item is listed it is set to run for 30 days.
A start_time and end_time timestamp is inserted in to the database.
The online_status field in the db is updated to 1
This means it is displayed on the site
After the 30 days when the (end_time < start_time) the online_status field need to be updated to 0, which means the item will not be displayed on the site.
Now I have accomplished this by adding php code to update that record if the above is true.
However the only way to change the online_status, is for the user to login in and view the items in the control panel. You can actually see the status change wording change from online to offline which I have built in.
This is obviously no good, as it needs to be done automatically. A user might not log in for 10 days which means the item online_status would never change until they login.
So how would I do this?
Could I run a cron job every minute to access a .php script that
1) Runs a query on the products table to check if end_time < start_time
2) If end_time < start_time update the online_status to 0
This is fine, but what happens if I have 10,000 items in the table.
Thanks for your help