| Forum Home | ||||
| Press F1 | ||||
| Thread ID: 58442 | 2005-06-01 01:07:00 | MYSQL deleting records older than 30 days | Morgenmuffel (187) | Press F1 |
| Post ID | Timestamp | Content | User | ||
| 360125 | 2005-06-01 01:07:00 | MYSQL deleting records older than 30 days Hi all, should be simple, but I'm getting confused between the various time stamps, PHP and mysql the situation is this I have a table it has records with a time field of type timestamp(14), now I am accessing it through PHP and what I want to be able to do is delete any records older than 1 month, but I am getting utterly confused, do i have to convert things to php and then back again to MYSQL to calculate the 30 days, And how do I specify 1 month as the records are in the form 20050601112940 If there is a simple way of doing this I would be interested, Thanks |
Morgenmuffel (187) | ||
| 360126 | 2005-06-01 01:24:00 | Problem Solved I'm an idiot I forgot to put records in the table SELECT * FROM a_cart_cookie WHERE DATE_SUB( CURDATE( ) , INTERVAL 30 DAY ) <= cookie_date LIMIT 0 , 30 |
Morgenmuffel (187) | ||
| 1 | |||||