in reply to Re: calculating 24 hours ago with localtime
in thread calculating 24 hours ago with localtime

using NOW(), how would I setup the database then? Right now I am using time VARCHAR(25) for the time field and I am inserting the $localtime as a string.

Yes, this is MySQL and you are right. Two tables. One for the last 5 minutes. One for the last 24 hours.

  • Comment on Re^2: calculating 24 hours ago with localtime

Replies are listed 'Best First'.
Re^3: calculating 24 hours ago with localtime
by McDarren (Abbot) on Dec 09, 2005 at 08:28 UTC
    using NOW(), how would I setup the database then? Right now I am using time VARCHAR(25) for the time field and I am inserting the $localtime as a string.

    When you create your database table, use a datetime data type for your time field.

    The mysql NOW() function returns the current date/time, so you simply use this for both your INSERTs and DELETEs

    Cheers,
    Darren :)