Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Rhinorhino on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Purge mysql timestamps from 1 hour ago or older 1

Status
Not open for further replies.

thedaver

IS-IT--Management
Joined
Jul 12, 2001
Messages
2,741
Location
US
If MySQL 3.23.59 table is

create table formtokens
-> (ft_token char(34) not null unique,
-> ft_data char(255),
-> ft_touched timestamp(14),
-> index idx_ft_token (ft_token));

What is the PHP code to tell MySQL (via a function) to drop entries in this table that are older than 60 minutes??? It's harder than it appears. Do I convert to unix_timestamp!?

Surfinbox.com Business Internet Services - National Dialup, DSL, T-1 and more.
 
if you are doing this, then its best to store a unix timestamp and compare that to the current unix timestamp...there are some issues with mysql timestamps not working correctly when doing this type of function.

post code for record removal
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top