Adding SQL data using a for loop