maxa
|
| Posted: 11/11/2002, 12:38 PM |
|
How can I make message on board time limited??
Message is write in database 11/11/02 and is visible next 10 days until 21/11/02 on board.
After that message is automatic deleted from database.
Is there some simple solution for this???
Thanks
|
|
|
 |
RonB
|
| Posted: 11/11/2002, 3:02 PM |
|
you didn't state your database so I'm assuming it's mysql. With mysql you can easely put this feature in the actual sql statement:
selectbla, blabla, message_date from your_table
where now() >= DATE_ADD(message_date,interval 10 day)
I'm sure that if you use some other database server there is a simular function for this. This way you get the result clean from the databse instead of having to go through the result set with php wich takes more time.
Have a look here for other nice date/time functions with mysql: http://www.mysql.com/doc/en/Date_and_time_functions.html
|
|
|
 |
RonB
|
| Posted: 11/11/2002, 3:12 PM |
|
Sorry,
should be:
select bla, blabla, message_date from your_table
where now() <= DATE_ADD(message_date,interval 10 day)
|
|
|
 |
maxa
|
| Posted: 11/12/2002, 2:27 AM |
|
How can I make message on board time limited in mdb database(microsoft access)??
Is there some simple solution for this like some script or something???
|
|
|
 |
RonB
|
| Posted: 11/12/2002, 3:00 AM |
|
Like I said, look at the mysql sample I provided. Go to acces and look for date/time functions via sql in the help file. You should be able to use most of the sql statement providing you use the acces date function instead of the date_add function in mysql. You didn't state wich programming language you use(probably asp because of your use of acces) maybe asp has simular date/time function you could use in a BeforeShow event.
Take the time to look it up. That is the only way to learn.
|
|
|
 |
|