selecting record between dates

by 3 replies
4
#programming #dates #record #selecting
  • What does a typical date look like in the table?
  • If it's just time() just do (for example, and assume you're talking about PHP/SQL):

    WHERE `timestamp` > '".(time() - (60*60*24))."'
    Would get you from 24 hours ago until now.

    time being current time, and 60*60*24 being -> 60 seconds, times 60 minutes, times 24 hours.
    • [1] reply
    • You can use the date function in PHP to output the date in any format you choose.

      W3Schools has an explanation: PHP Date() Function

      Mike

Next Topics on Trending Feed

  • 4

    I need to select record from a table in my database.the table field has a varchar type that holds date data.I want the records to be displayed according to the date selected by the user desc.The problem is that the record displays only data by the day and not by month.i want a chronological display of data.