I need this to be run every 24 hours:
delete tags from tags left join tagowners on tags.id=tagowners.tagId
where tagowners.tagId is null;
I need this to be run every 24 hours:
delete tags from tags left join tagowners on tags.id=tagowners.tagId
where tagowners.tagId is null;
Execute this first in SQl Query Browser
then execute this one. It will trigger every 24 hours at 12:00 AM
Running on a Linux system? Use
cron
. I don't think MySQL has built-in functionality to accomplish this.If you're on a linux server you can create a cronjob, a scheduled task, to execute the php script through the php executable. Creating a cron task is easy, execute 'crontab -e' through the shell, then add your command to the bottom of the file.
Example cron entries taken from http://mkaz.com/ref/unix_cron.html
If you wanted to execute a php script once a day...
Remember, you're executing the script through the CLI, so the
$_GET
/$_POST
/$_SERVER
super globals won't exist (you can get around this by using wget).If you're on windows, you can use windows task scheduler to accomplish the same.
With cron: