questa è la sezione php non sql

cmq dovrebbe essere

select tabella1.comune from tabella1,tabella2 where tabella1.user=tabella2.user and tabella1.tipo=1