My datetime field is like this: Tue May 05 00:07:32 2015
The SQL Query that I am using in my php code is:
Select * from logs WHERE Date BETWEEN '".$from."' AND '".$to."'
Date is my column name
$from and $to are the variables in php that store datetime, in the same format as the one in my database.
This query extracts wrong results, that is, it does not show me the results that is in my mentioned range. What could be the problem?
Suppose when I write:
$from= Fri May 01 00:00:00.000 2015
$ to= Sun May 31 23:59:59.999 2015
It displays the result from 1st May to 4th May only, not till 31st May