Thread: Need PHP help
View Single Post
  #2 (permalink)  
Old 2006-06-16, 12:07 AM
albinomonkey albinomonkey is offline
Junior Member
 
Join Date: Sep 2005
Posts: 2
albinomonkey
Default sure

Ok as for your update at midnight script, basically you'll just add a table to your database for timed scripts. You'll first need a field for the time when to run EX: midnight, then you'll need a date last updated (which will be reupdated everynight at midnight). Basically all you do is place this code in your index page, when the first user stumbles across your site after midnight it will update, so... You determine wether the script has been run after midnight when a user accesses. You must take the current date and current time in PHP then use your database to compare to it your fields for the time to update, the last date updated. Now you must see wether your current date is 1 day greater than your last updated date (stored in the database), and you may need to know wether the time is after your update time (midnight).
Reply With Quote