PHP MySQL Cron job help needed

by 9 replies
12
I am trying to automate my site a little by implementing some
repetitive taskes I do everyday into a cron job php script.

I have several pieces of MySQL code that I use directly into
my database using phpmyadmin and so what I want to do is
create a php page, say cron.php, and then put all these individual
pieces of MySQL scripts in there.

So it would be something like.

DELETE these items

then

UPDATE these items

then

UPDATE these different items.


So what I would like to know is how to join up
these different items in php/MySQL.

I would also like to allow about 15 seconds in between each command to allow
the database to perform the task safely. S ohow do I space out each command by
15 seconds.

Any help much appreciated.

Terry
#programming #cron #job #mysql #needed #php
  • You don't need to space them out. Just put all the commands into one batch file and execute that.
    • [ 1 ] Thanks
    • [1] reply
    • Thanks KirkMcD

      I didnt realise you could just put them all in one file without
      any extra script.

      Thats real simple then.

      Thanks again.

      Terry
      • [1] reply
  • Banned
    [DELETED]
    • [1] reply
    • Hey Terry,
      Are you putting a semicolon at the end of each line?

      That might do the trick....

      If it doesn't, go ahead and copy/paste the PHP code into your post. I'll take a look at it and give you my two cents.

      Jon
      • [ 1 ] Thanks
      • [1] reply
  • Glad to help Terry!

    Have fun,
    Jon

Next Topics on Trending Feed