Page 1 of 1

Select from timestamp column

Posted: Mon Dec 13, 2004 8:40 am
by TheOracle
OK, bit out of my depth now on this app I'm trying to build.

I have a table with a timestamp column which is automatically updated with now() when the records are inserted.

However, on the page where I want to be able to view the info I need to give the option to view info from within a certain amount of time.

So in the select I need to put something like:

Code: Select all

where timestamp < now() + 28
But I'm quite sure this won't work. Is there a better way?

Can anyone also offer some guidance on providing a "delete" link for each of the records returned. They do have a unique ID

Many thanks in advance

Posted: Mon Dec 13, 2004 2:26 pm
by xisle
something like this..

Code: Select all

timestamp > DATE_SUB(NOW(), INTERVAL 1 MONTH)
lookup date_add() as well at mysql.org,
not sure which one you need