Im making a SQL like this:
SELECT * FROM POST
WHERE date between :date1 and :date2
Date2 always is going to be today date PHP time(); (UNIX FORMAT). Now I need take date2 minus 7days ( 1 week) and date2 minus 1 month.
(This will be choosen by the user on a form).
The problem is that i can't get a operation with UNIX dates work.
$date2 = time();
$date1 = $_GET['fromDate'];
$query = "SELECT * FROM POST
WHERE date between :date1 and :date2";
HTML FORM
select id=fromDate>
<option value=<?php echo time()-604800>WEEK</option>
/select>