just need a little help here I hope you can help me with my simple problem.
I have a table that consist of shops data. In my PHP page the user can register their shops. And in registration the day that the user registered his/her account will be save in the database table and will format as a TIMESTAMP.
I have no problem with that. In my backend page there is a form for advance searching method. In my form, there is a dropdown field and beside it there is a datepicker that will format as mm/dd/yyyy so I have a 2 datepicker for that which is from and to.
My problem is:
I formatted the datepicker result using the strtotime() function in PHP. And I have a query like this.
$query = "SELECT * FROM shops
WHERE status = '".$status."'
AND registered BETWEEN ('".$from." AND ".$to."')";
Sample output of query is:
SELECT * FROM shops WHERE status = 'P' AND registered BETWEEN ('1388505600' AND '1391097600');
Now I have a timestamp result for $from and $to. How can I filter it in mysql?
Ok that's all. Thanks in advance.