SitePoint Sponsor

User Tag List

Results 1 to 7 of 7

Thread: php server time

  1. #1
    SitePoint Guru
    Join Date
    Sep 2007
    Posts
    971
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    php server time

    is there a way to make my database erase a whole table when the server time hits 5.00am?

  2. #2
    SitePoint Addict
    Join Date
    Apr 2005
    Posts
    287
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Cron Job works fine.
    How does that make your feel?

  3. #3
    SitePoint Addict silentcollision's Avatar
    Join Date
    Jun 2006
    Location
    New Zealand
    Posts
    388
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    If you want to delete the table, use drop, otherwise just truncate the table to retain its structure.

  4. #4
    SitePoint Guru
    Join Date
    Sep 2007
    Posts
    971
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    is there any way apart from cronjob like as a php file

  5. #5
    SitePoint Addict
    Join Date
    Apr 2005
    Posts
    287
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    well the cron job would call the php file.
    How does that make your feel?

  6. #6
    SitePoint Zealot
    Join Date
    Oct 2007
    Location
    In the blogosphere
    Posts
    108
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    You could try googling 'fake cron' scripts
    bLueFrogX's Blog - Random Ramblings of a NEET Techie ★

  7. #7
    SitePoint Wizard stereofrog's Avatar
    Join Date
    Apr 2004
    Location
    germany
    Posts
    4,324
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    You can simply add this logic to your main script (index.php):

    Code:
    if time is past 5.00 and table is not deleted
       delete table


Bookmarks

Posting Permissions

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