the loop is executing one table only donno what is wrong