Last 5 minutes of entries

Questions about the MySQL, PostgreSQL, and most other databases, as well as using it with PHP can be asked here.

Moderator: General Moderators

Post Reply
User avatar
Todd_Z
Forum Regular
Posts: 708
Joined: Thu Nov 25, 2004 9:53 pm
Location: U Michigan

Last 5 minutes of entries

Post by Todd_Z »

In an attempt to deter double posts, I want to select the rows in a

Code: Select all

 db that have been posted in the last 5 minutes, the form is a timestamp(14) i.e. 20050606163000 = june 6 2005 4:30 - anyways - hows it done?
timvw
DevNet Master
Posts: 4897
Joined: Mon Jan 19, 2004 11:11 pm
Location: Leuven, Belgium

Post by timvw »

http://dev.mysql.com/doc/mysql/en/date- ... tions.html

Code: Select all

SELECT *
FROM table 
WHERE WHERE DATE_SUB(NOW(),INTERVAL 5 MINUTE) <= timestamp
User avatar
John Cartwright
Site Admin
Posts: 11470
Joined: Tue Dec 23, 2003 2:10 am
Location: Toronto
Contact:

Post by John Cartwright »

Moved to Databases.
Post Reply