0

I need to be able to execute either a php or jquery function to update a sql database every certain segment of time, 20 minutes for example, regardless of user activity on the website. Does anyone know the easiest way to do this? Thanks, any help is appreciated.

5 Answers 5

2

The easiest way would be to make a PHP script that does the update, then use a CRON Job to run it every 20 minutes.

Sign up to request clarification or add additional context in comments.

1 Comment

thanks for the quick responses guys, I've used a cron before on my own server, but i recently bought hosting on bluehost, can run cronjobs on my hosting like that?
1

I guess you're looking for a cronjob on *nix (or "Scheduled Tasks" on Windows).

Comments

0

Use a cron job that executes a php page:

wget http://www...com/cron.php

Put your database update script in cron.php

Comments

0

There is a solution but you have to have access to command line. But for information: You can make a php engine. So make a infinite loop while(true), inside use a sleep function and make the proper updates.

Comments

0

I got it, on bluehost I just go to cronjobs and input the path to the php script, it worked great, thanks

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.