im looking at the manual entry for timestamp and it's not clearing thisup for me. i have a table where i use it to find out when a user requested an email verification and want to delete those that are more then 24 hours old.
i set something up and currently have for a sql statement: DELETE FROM tabl WHERE timestampfeild<(NOW()-(24*60*60))
thing is i don't know how the timestamp feild works. can any of the db gurus tell me if that would remove all entries more than 24 hours old?
if not, where is the failure in my thought rocess of doing that and what do i need to know to correct it? and do you have any refrences aside fomr the mysql manual from mysql.com that i can use in the future?
question on dealing with the mysql timestamp feild
Moderator: General Moderators
- twigletmac
- Her Royal Site Adminness
- Posts: 5371
- Joined: Tue Apr 23, 2002 2:21 am
- Location: Essex, UK
MySQL's timestamp is in the form YYYYMMDDHHMMSS - it isn't a UNIX timestamp:
http://www.mysql.com/doc/en/DATETIME.html
If you need to manipulate a date, you need MySQL's date and time functions (one type is that shown in markl999's SQL example):
http://www.mysql.com/doc/en/Date_and_ti ... tions.html
Mac
http://www.mysql.com/doc/en/DATETIME.html
If you need to manipulate a date, you need MySQL's date and time functions (one type is that shown in markl999's SQL example):
http://www.mysql.com/doc/en/Date_and_ti ... tions.html
Mac