How to update the db continuously?

Discussion in 'PHP' started by YourChild, May 20, 2008.

  1. #1
    I have a script that updates the database. Everytime a user logs in, it will update the database. I am trying to do the updating every few seconds however...waiting until a user logs in is kind of sloppy. Is there a way I can place this script on the server and have the server run the script continuously without having the website opened by anyone?
     
    YourChild, May 20, 2008 IP
  2. jestep

    jestep Prominent Member

    Messages:
    3,659
    Likes Received:
    215
    Best Answers:
    19
    Trophy Points:
    330
    #2
    What are you updating the database with? Generally it isn't ever necessary to update a database without having some change caused by users or another trigger-able factor.

    Otherwise, you could use a crontab to run a php script, or cron and wget to run an actual page on your site.
     
    jestep, May 20, 2008 IP
  3. Small Solutions

    Small Solutions Peon

    Messages:
    8
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #3
    A cron-job would be your best solution, a file set to run every so often by the server to carry out different tasks; in your case update your database.
     
    Small Solutions, May 20, 2008 IP
  4. YourChild

    YourChild Peon

    Messages:
    22
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #4
    I'm updating the database constantly because I got a chatroom running .. need to remove users etc

    what on earth is a cron-job/cron-tab/wget? I've never heard of it before. I'll have to do some research to hook this up. Hopefully its not too crazy. thanks for the input.
     
    YourChild, May 20, 2008 IP