|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
Get inside! Sample the range of functionality easily built with JMSL Library for Time Series Data Analysis, Heat Maps, Portfolio Optimization, Monte Carlo Simulation, Stock Price Charting and more. Download Now! |
|
#1
|
|||
|
|||
|
Can make a table that some how entries will expire and do something or maybe just delete themselves after a certain perdiod of time or at a certain date?
Is there a data type for that? thanks, mike |
|
#2
|
||||
|
||||
|
Hi,
You can't set expiry date in the table. You should write a program that should delete the values of a particular period. eg: "DELETE FROM tablename WHERE TO_DAYS(NOW())-TO_DAYS($date_field)=60"; And above script should work frequently in your server. Perhaps you may use "cron job" for performing frequent action in the server... |
|
#3
|
|||
|
|||
|
<BLOCKQUOTE><font size="1" face="Verdana,Arial,Helvetica">quote:</font><HR>Originally posted by Mikeage:
Can make a table that some how entries will expire and do something or maybe just delete themselves after a certain perdiod of time or at a certain date? Is there a data type for that? thanks, mike[/quote] Mike, I saw this somewhere. You need an entrydate int, and expiredate int, in your table and then sth like this included in a function ExpireThings() $today = Date("Ymd"); $sql = "DELETE FROM things WHERE expiredate<$today"; Brian |
![]() |
| Viewing: Dev Shed Forums > Databases > MySQL Help > Expiring Table Entries? |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|