Get data using user selected date

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • ghjk
    Contributor
    • Jan 2008
    • 250

    Get data using user selected date

    I'm developing web site using php and mysql. In there user has to select a date, and data belongs to that date should print.My date field type is datetime.
    This is my code and it is not working.Could you please help me?
    GDate-> user selected date

    [PHP]SELECT Rainfall,Date FROM rainfall WHERE CAST(Date as DATE)='$GDate' AND SID='$GSID'[/PHP]
  • ronverdonk
    Recognized Expert Specialist
    • Jul 2006
    • 4259

    #2
    Depends on the format of the date in the $GDate variable. It should be YYYY-MM-DD.

    Ronald

    Comment

    Working...