$sql3 = mysql_query("SELECT DISTINCT t1.id_aula FROM aulas AS t1, datos AS t2 WHERE t1.id_aula<>t2.id_aula") or die(mysql_error());