Quantcast
Channel: Programming Forums
Viewing all articles
Browse latest Browse all 51036

mysql date range not working properly?

$
0
0
my database field format is datetime, and HTML form input type is 'text'. how come I cannot extract the correct range?

$start=$_POST['start'].' 00:00:00';
$end=$_POST['end'].' 23:59:59';
$start=date('Y-m-d H:i:s',strtotime($start));
$end=date('Y-m-d H:i:s',strtotime($end));
...
$sql="select * from table where paytime BETWEEN '".$end."' AND '".$start."'";


I also tried <= and >=

neither returns correct results?

Viewing all articles
Browse latest Browse all 51036

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>