I need the user to select a date in the combo box, change the value of the variable corresponding to the period in WHERE, so that it shows the table only of the corresponding period.
SELECT
<select id="data">
<?php
$data = mysql_query("SELECT DISTINCT 'periodo' FROM 'informatica_relatorio'") or die(mysql_error());
while ($row = mysql_fetch_array($data))
{
echo '<option>'.$row['periodo'].'</option>';
}
?>
</select>
<input type="submit" value="OK"/> <!-- Botão para confirmar o período -->
In another PHP file I have the following part that needs to have the value changed.
$dfbruto = mysql_query("SELECT SUM(valor) FROM informatica_relatorio WHERE 'empresa' = 'DF' AND **VARIÁVEL DO PERÍODO AQUI** GROUP BY 'centro_custo'") or die(mysql_error());