2 tabelle
NOTIZIE
id | padre | categoria | titolo
1 1 2 prova
NOTIZIE_categorie
id | padre | categoria | section | url
1 0 arte arte arte.dominio.com
2 1 mostre mostre arte.dominio.com
dovrei prendere i seguenti dati:
id_notizia | titolo_notizia | section_categoria_notizia | section_padre_notizia |
1 prova mostre arte
Ho provato così
Codice PHP:
SELECT notizie.id, notizie.titolo, notizie.descrizione1, date_format(notizie.data_ins, '%a, %d %b %Y %H:%i:%s GMT') AS pubDate, notizie_categorie.url, notizie_categorie.categoria, notizie_categorie.section FROM notizie INNER JOIN notizie_categorie ON notizie.padre=notizie_categorie.id WHERE notizie_categorie.section='arte' AND notizie.tipologia='1' AND notizie.attiva='si' ORDER BY notizie.data_ins DESC
Mi tira fuori il padre ma non la sottocategoria.
Come faccio?