0
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 to 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, for example 13-10
, then the query line should return everything above the 13th day of the 10th month, but this giving error. In this case, the variable $data_atual
takes the server’s day and month to query and check with the start column.
Which error is returning ?
– NoobSaibot
https://dev.mysql.com/doc/refman/5.7/en/date-and-time-functions.html use data functions as year(0 , Month() and now()
– Motta
the error is that it does not return the values @Wéllingthonm.
– Jonnys J.
@Motta , had forgotten the NOW() function, I’m now searching to see if I can solve the code
– Jonnys J.