Schedule update SQL Query using Php -


I have is manually collected from a website with a mobile phone prices and external Siaits all prices, I want to schedule updated prices ( $ emag, $ koyos ) every 3 days.

I manually update query is:

  $ editare = "update Modle set Koyos = '$ Koyos', emag =' $ emag 'WHERE id =' { $ Id} '"; If ($ dbh- & gt; Query ($ editare)) {print "
>

How do I automate this question in 3 days?

! My webhost cronjob SSH, cPanel or Plesk !

First of all, you do not support the need to write a script in PHP that you want to do (Basically, this is just your PHP code that you want to run at scheduled times, there is no additional requirement).

Then, cron jobs , you schedule it to run as often as you want.

* / 4 * * * * wget --spider file.php Runs in the cronat every 4 minutes you might want to read on some.

Here is a picture from the link given below: How to schedule time:

 enter image description here


Cronjobs originally schedules every time that so often runs are really useful, and I have all of them on Linux Use time.

The link given above is really useful for the number of which you can type, execute a script every x min in minutes, but you can use the "cron job calculator" for the correct number of yourself. Google needs to compute (I sometimes do this myself).

installed with Linux, crontab, crontab -l Type To edit a list of your Kronbob list for existing users of all Kronojhon crontab -e . This is where you paste the above code.

Edit: To get your head around the chronogenics at the original level, first install the crontab, then use the code above to execute a script that is writing a file. Then, just tick that file Tail-F and see how it crashes (4 minutes after the start of the cron), it updates in front of your eyes.

Start with the basics and then execute your MySQL script.

Useful Links:


(It feels good)

(min / day explanation)

Note : You can not do less than a minute The previous link shows that the sleep () command is to move around it, so check it out.


The problem with OP question is that because it is very restricted shared hosting, it does not have SSH, CPNL, Kronobose or something like that.

Here's to spin different process Dblugititing the PHP file using an option exec () , or shell_exec () , Nohup and finally with an ampersand (& amp;), a long with sleeping code for the number of days. This will cause the PHP script to run on the server in the background.

The security measure must be kept in the above example, i.e .: if the server reboots, the script will not run and must be restarted. Conversely, if the user accidentally makes a script (or some other) on the wrong time, multiple processes will be created, so it is the security to check whether the process is already running (or a basic password entry May be required to avoid casual hits).

Comments

Popular posts from this blog

excel vba - How to delete Solver(SOLVER.XLAM) code -

github - Teamcity & Git - PR merge builds - anyway to get HEAD commit hash? -

ios - Replace text in UITextView run slowly -