I am trying to ouput a query from database with this code and I probably have a syntax error.
Code works when I put the actual date manually inside the query (eg. <= '$2007-01-01' AND endperiod >= '2007-01-01'");) but when use the variables that I get thru form it doesn't work.
Those same variables work for some other query in that set though.
I would really appreaciate the help.
$start = $_POST["start"];
$end = $_POST["end"];
$start_ts = strtotime($start);
$end_ts = strtotime($end);
$sql=mysql_query("SELECT endperiod from obresti WHERE startperiod <= '$start_ts' AND endperiod >= '$start_ts'");