I'm trying to filter some query results with a 'select' system. But I'm having zero success...
Here is the select code:
echo "<select name='period'>";
echo "<option value='select-period'>Select a period</option>";
echo "<option value='today'>Today</option>";
echo "<option value='7 days'>Last 7 days</option>";
echo "<option value='30 days'>Last month</option>";
echo "<option value='365 days'>Last year</option>";
echo "</select>";
Here is the query code:
$sqlCidade = "SELECT count( * ) FROM $table_name WHERE form_value REGEXP '.*\"city\";s:[0-9]+:\"$valorCidade\".'";
Everything works perfectly. But I need to filter the results based on the select options. I tried with an
AND form_date > current_date - interval '7 days'
at the end, but it didn't worked.
(form_date
is the column on the db that has the posting date)