My code should return values from the database, related to the current day (today), but only related to the month and day, I searched a lot but could not find something that would help me
$data_atual = date("d-m");
$mostraDados = mysqli_query($conecta, "SELECT * FROM sql WHERE ativo = 's' AND inicio >= '".$data_atual."'")or die (mysqli_error());
In the column inicio
of the table is the date, such as 13-10
, then the query line should return everything above the 13th day of month 10, but this is giving error. In this case, the variable $data_atual
takes the day and month of the server to make the query and check with the start column.