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: Time / Date

  1. #1
    Regular Coder
    Join Date
    Jul 2005
    Posts
    153
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Time / Date

    I have a database that stores comments to pictures on my site, each comment has the time attaced to it.

    February 9, 2006, 11:03 pm



    I want a page that displays comments from today...


    PHP Code:
    $date1 date("F j, Y, g:i a")
    $sql "SELECT * FROM comment WHERE comment_date = '$date1'"
    But the only problem is the time? because it will only show comments added at 11:03pm

    Can any one help?

  • #2
    raf
    raf is offline
    Master Coder
    Join Date
    Jul 2002
    Posts
    6,589
    Thanks
    0
    Thanked 0 Times in 0 Posts
    what db + what columntype is it? --> you best use the db-functions to transform/extract the date and evaluate that inside your where clause
    Posting guidelines I use to see if I will spend time to answer your question : http://www.catb.org/~esr/faqs/smart-questions.html


  •  

    Posting Permissions

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