I'm trying to display a query ordered by the month of a field date , in phpmyadmin
the query comes out right and when I display the result of the same query with php the date quit the correct order.
query:
"select calendario.id_calendario, calendario.id_download, eventos.id_evento, eventos.descricao, str_to_date(concat(dia, '/', mes, '/', ano) , '%d/%m/%Y') as data
from calendario
inner join eventos on calendario.id_evento = eventos.id_evento
order by month(data) asc , eventos.descricao asc"
In mysql this displays (the correct one)
andinphpitdisplayslikethis
The only difference is that I format the date in php for dd/mm/aaaa
but this is after the query, has anyone else gone through this?