If I have a date variable formated as follows date("Y-m-d H:i:s");
How can I subtract the current time from a field in my database to see if it is less than 30 seconds.
ie. select * from table where $curtime - time < 30seconds
I'd think (now() - field) < 30 would work. Peruse the manual's date and time functions http://www.mysql.com/doc/en/Date_and_time_functions.html