Can I timed my sql rows?

Discussion in 'MySQL' started by cloudnthunder, Nov 25, 2009.

  1. #1
    Hi is it possible to time my rows, so that after 24 hours has elapsed for a particular row, it made an automatic update or insert?
     
    cloudnthunder, Nov 25, 2009 IP
  2. insert

    insert Peon

    Messages:
    148
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #2
    you can set up cron script which will be checking the rows lets say every 10 minutes, ale if any is older > 24 it will update it...
     
    insert, Nov 25, 2009 IP
  3. cloudnthunder

    cloudnthunder Peon

    Messages:
    163
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #3
    what is cron script?
     
    cloudnthunder, Nov 25, 2009 IP
  4. insert

    insert Peon

    Messages:
    148
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #4
    cron is linux service, which can execute files, for example php files with code for checking you mysql record, in this case..
     
    insert, Nov 25, 2009 IP
  5. inanobot

    inanobot Peon

    Messages:
    46
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #5
    For example, you have this php file:
    <?php
    mysql_query("INSTERT INTO `table`(`a`,`b`) VALUES ('1','2');
    ?>

    And the file is located in this path: /home/yourdomain/public_html/network/cronjob.php

    Now in cPanel, goto Cronjob --> Advanced:
    Command: php -q /home/saffilia/public_html/network/cronjob.php
    Minute: *
    Hour: */24
    Day: *
    Month: *
    Weekday: *


    Hope it helps
     
    inanobot, Nov 27, 2009 IP
  6. cloudnthunder

    cloudnthunder Peon

    Messages:
    163
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #6
    thx i got the picture now.
     
    cloudnthunder, Nov 30, 2009 IP