Results 1 to 4 of 4
  1. #1
    Join Date
    Jun 2006
    Posts
    4,832
    Tokens
    0

    Latest Awards:

    Default Cron job for SQL

    Hey,

    I have a row in a sql table, and I want to know how I can empty it or set all of them back to zero.

    IE

    UPDATE `users` SET `reptime` = 0 WHERE `id` = *
    (not sure if that's 100% right, the last part)

    but how would I do it with a cron job?

    Cheers!
    Last edited by Hitman; 30-12-2007 at 10:40 PM.

  2. #2
    Join Date
    May 2006
    Posts
    1,797
    Tokens
    0

    Latest Awards:

    Default

    UMMM.

    I think theres a way to do it if you put the command in the file and get the cron job to run the file..

    But i have no idea how.

    EDIT:

    Put it in a file, then do the cron command

    php -f /home/YOUR ACCOUNT USERNAME/public_html/PATH TO FILE
    Last edited by MrCraig; 30-12-2007 at 11:00 PM.
    Coming and going...
    Highers are getting the better of me

  3. #3
    Join Date
    Jun 2006
    Posts
    4,832
    Tokens
    0

    Latest Awards:

    Default

    Quote Originally Posted by MrCraig View Post
    UMMM.

    I think theres a way to do it if you put the command in the file and get the cron job to run the file..

    But i have no idea how.

    EDIT:

    Put it in a file, then do the cron command

    php -f /home/YOUR ACCOUNT USERNAME/public_html/PATH TO FILE
    Thanks! I shall test it.

  4. #4
    Join Date
    Jun 2006
    Posts
    4,832
    Tokens
    0

    Latest Awards:

    Default

    I'm adding info! Plus can't edit.

    That didn't work.

    I have the file named cron1.php, with the code in it. So when I visit the page it executs it. I now understand the cron command needs to be something where a browser on the server visits this page. What would be the commad for that?

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •