0
Colleagues,
I have a table where you have the Mysql datetime() field. I would like to take a given month directly from the Where clause. By PHP I know how to do, but how would I do directly by query? I tried this way to get the May records but it didn’t work:
$mês = $_POST["MesBusca"]; // Vamos supor que seja mês de maio (05)
SELECT * FROM tabela WHERE MONTH(DataAbertura) = MONTH(".$mes."); // Tentei também com o 5
That’s the code right there. Maybe not adding the year otherwise it will take all the records of May of all the years registered in the bank. What is the query problem? returns nothing? returns more?
– rray
Hello rray. Returns nothing. I edited my post with a column print.
– user24136
I don’t quite understand what you want
– GabrielLocalhost
See my response below.
– GabrielLocalhost