Page 1 of 1

PHP how to update database?

Posted: Fri Apr 25, 2008 12:39 am
by php_postgresql
I dont know what to put in my subject because I dont know how to categorize my question. I need people's suggestions on how will I do this...

I have managed to compare the current dates and expiration dates of records. When they fill up a form I have this expiration question thingy so there. I was able to store in my database if the product is still OK or not OK. I used the timestamps thingy to do compare current date and expiration date...( the strtotime() )...

but then how would the database know if it is still OK the next day? when someone created a profile for example it is not expired today (so it is flagged OK in the database) but tomorrow it will be expired (so it should be flagged "NOT OK").

how can I update the database?

Re: PHP how to update database?

Posted: Fri Apr 25, 2008 12:46 am
by Christopher
Compare the date in the record with NOW().

Re: PHP how to update database?

Posted: Fri Apr 25, 2008 1:48 am
by mchaggis
If you want the database to "automatically" update, then the only real way to do it would be to have a scheduled task (cron) on the server that performs the check and does the update. It looks like you have the code/sql how sussed, just seems you are wondering how you can do it without intervention?