SitePoint Sponsor

User Tag List

Results 1 to 6 of 6
  1. #1
    SitePoint Member
    Join Date
    Jan 2004
    Location
    london
    Posts
    11
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    automatic creation of an SQL table in a php script after a certain time?

    Hi there,

    I was just wondering if there is a way of creating an SQL table (with values) in a php script that creates this table automatically once a day at a certain time of a day that I specified. Basically, I want my php script to create a table once a day at 10pm every night. Is this possible with some sort of timer?

    Thanks

    Saeed

  2. #2
    chown linux:users\ /world Hartmann's Avatar
    Join Date
    Aug 2000
    Location
    Houston, TX, USA
    Posts
    6,455
    Mentioned
    11 Post(s)
    Tagged
    0 Thread(s)
    You would need a cron job to complete the task you are wanting. Basically you would write the script and then have cron call it every night at 10pm.

    Here is a tutorial: http://www.phpfreaks.com/tutorials/28/0.php
    And another:
    http://www.webmasters-central.com/t/cron.shtml

    Hope that helps!

  3. #3
    PHP manual bot bronze trophy Gaheris's Avatar
    Join Date
    Oct 2003
    Location
    Germany
    Posts
    2,195
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    You can't do that with PHP alone, but you could call the PHP script with help from cron jobs.

    Edit:

    Too slow.

  4. #4
    SitePoint Member
    Join Date
    Jan 2004
    Location
    london
    Posts
    11
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by Hartmann
    You would need a cron job to complete the task you are wanting. Basically you would write the script and then have cron call it every night at 10pm.

    Here is a tutorial: http://www.phpfreaks.com/tutorials/28/0.php
    And another:
    http://www.webmasters-central.com/t/cron.shtml

    Hope that helps!

    Thanks for the help. But is Cron only compatible with UNIX/LINUX? Because Im using Windows

  5. #5
    SitePoint Member
    Join Date
    Jan 2004
    Location
    london
    Posts
    11
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Thanks for the help. But is Cron only compatible with UNIX/LINUX? Because Im using Windows

  6. #6
    PHP manual bot bronze trophy Gaheris's Avatar
    Join Date
    Oct 2003
    Location
    Germany
    Posts
    2,195
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Yeah, cron is only for UNIX/LINUX. In windows you have the so called scheduled tasks.


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
  •