Esegui la query e cicli sul risultato per generare l' html relativo