SELECT
p.id as id,
p.fk_id_user,
p.fk_category,
DATE_FORMAT(p.data, '%d.%m.%Y') as data,
DATE_FORMAT(p.data_inizio, '%d.%m.%Y') as data_in,
DATE_FORMAT(p.data_scadenza, '%d.%m.%Y') as data_out,
p.data_inizio,
p.data_scadenza,
TXT_GET_MESSAGE(p.txt_titolo,'en','it') as titolo,
TXT_GET_MESSAGE(p.txt_abstract,'en','it') as estratto,
TXT_GET_MESSAGE(p.txt_text,'en','it') as corpo,
p.url_picture,
TXT_GET_MESSAGE(p.txt_mk,'en','it') as metakey,
TXT_GET_MESSAGE(p.txt_md,'en','it') as metadesc,
c.cat_it as cat
FROM ar_posts p
INNER JOIN ar_posts_categorie c
ON p.fk_category = c.id
WHERE p.published = 1 ORDER BY p.data_inizio asc?