Welcome Guest, Not a member yet? Register   Sign In
How to clean up database in MYSQL
#1

[eluser]parham90[/eluser]
Hi there,

I am not quite sure how I could do this on a Windows host. I want the user accounts created (but not verified) in the last three days to be deleted every day, without a PHP page necessarily having been opened (E.G. something I can do without PHP?). is such a thing possible, or should I just take the best chances and put a PHP script in the homepage to check for these accounts and delete them every time the page is opened?

Thanks!
#2

[eluser]WanWizard[/eluser]
You can start a PHP script from the commandline, and call that from cron to have it run daily.

With a bit of tweaking you can even start CI controllers from the commandline (search the forum for cron).
#3

[eluser]parham90[/eluser]
I'm assuming that means it can't be done on a Windows server?
#4

[eluser]WanWizard[/eluser]
Why not?

On Windows you can do
Code:
C:\PHP5\php.exe -f "C:\PHP Scripts\script.php" -- -arg1 -arg2 -arg3

And use the scheduler to start this (or a batch file containing this) at a set time.
#5

[eluser]parham90[/eluser]
Ah. I was told (a year or so before) that the scheduler in Windows doesn't work with PHP arguments and such. Thanks for clearing it up!
#6

[eluser]WanWizard[/eluser]
I don't use Windows, so I wouldn't know.

But if it doesn't, simply create a batch file, put your PHP commandline in that file, and have the scheduler call that.
#7

[eluser]parham90[/eluser]
Thanks!




Theme © iAndrew 2016 - Forum software by © MyBB