salve,
ho 2 query quasi simili :
Codice PHP:
SELECT * FROM utenti AS a, notizie AS b, utenti_notifiche AS c WHERE a.id=b.user AND c.notizie_commenti='1' AND a.attiva='si' AND b.id='5208' GROUP BY a.user
SELECT * FROM utenti AS a, commenti AS b, utenti_notifiche AS c WHERE a.id=b.user AND c.notizie_commenti='1' AND a.attiva='si' AND b.id_art='5208' GROUP BY a.user
vorrei unirle e avere un array con i risultati. Ho provato ad applicare il metodo UNION
Codice PHP:
SELECT * FROM utenti AS a, notizie AS b, utenti_notifiche AS c WHERE a.id=b.user AND c.notizie_commenti='1' AND a.attiva='si' AND b.id='5208' GROUP BY a.user
UNION
SELECT * FROM utenti AS a, commenti AS b, utenti_notifiche AS c WHERE a.id=b.user AND c.notizie_commenti='1' AND a.attiva='si' AND b.id_art='5208' GROUP BY a.user
Ma mi da' questo errore: #1222 - The used SELECT statements have a different number of columns
cosa vuol dire?