La cosa es que tengo la siguiente consulta formada en MySQL:
Código PHP:
select *, dayofmonth(fecha_publicacion) as dia, dayofweek(fecha_publicacion) as semana, month(fecha_publicacion) as mes, year(fecha_publicacion) as year, date_format(fecha_publicacion,'%h:%i %p') as hora from jcgrm_noticias where importancia = 10 and visible<>0 order by RAND()
Código PHP:
select *, day(fecha_publicacion) as dia, month(fecha_publicacion) as mes, year(fecha_publicacion) as year from jcgrm_noticias where importancia = 10 and visible<>0 order by newID()
Salu2

PD: Donde puedo descargar un buen manual de SQL donde vengan todas esas funciones que le hacen falta a uno de vez en cuando?