Date format

If that date is stored in a database like this “2011-02-27 12:51:25”
I want to search history, where history is written in the text field in this format
I tried searching in this format “2011-02-27” did not retrieve any fields
any help?

SELECT this FROM that WHERE DATE(column) = '2011-02-27'


This method does not retrieve any data

Are you storing the data as DATETIME ?

yes,in this format “2011-02-27 12:51:25”

Can you post the output of this command please?


are you ~sure~ you’re using a DATETIME column?

why did you say a text field, then?

    $sqls ="select * from logs where timestamp between'$dst' and  '$dto' ";  

this is syntax i used but not work

i used textfield to insert the date on which I want to search for

You’re column datatype should be [URL=“”]DATETIME.

no it’s timestamp

So you are not storing it as DATETIME, as you previously said.


some people use unix timestamps, which of course are integers, stored in INTEGER columns

in any case, you can easily resolve this issue by letting us see the table – please do the SHOW CREATE TABLE as previously requested