Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 2 of 2

Thread: Today added

  1. #1
    New to the CF scene
    Join Date
    May 2006
    Posts
    6
    Thanks
    2
    Thanked 0 Times in 0 Posts

    Today added

    Hy,

    In my mysql database is row date, and it is in format 00-00-00 00:00:00

    And I want, in php file, show how many items is added today...

    So, $query="SELECT * FROM table WHERE date="TODAY"";

    how to put this correctly?

  • #2
    Regular Coder
    Join Date
    Nov 2002
    Location
    Manchester, UK
    Posts
    533
    Thanks
    4
    Thanked 1 Time in 1 Post
    not sure exactly, but something like

    $query = "SELECT * FROM table WHERE date = " . date("d-m-Y",time()) . "";

    not sure if you'll have a problem with times. You may need to use the current time and work out 24 hours ago, then do a WHERE date > start_time AND date < current time.


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •