World Cup insert_data.sh

Hi,
My insert data script is inserting each variable, altough within the same loop, into different rows in the games table. This offends the NOT NULL constraint, which is why I removed that just to understand what was wrong. So like this I end up with one variable per line in the games table, which makes #rows = #games*#variables = 32*6=192 rows. So this happens even when the insert statements directly succeed themselves like:
#ADD $YEAR

INSERT_YEAR=$($PSQL "INSERT INTO games(year) VALUES('$YEAR')")

#ADD $ROUND

INSERT_ROUND=$($PSQL "INSERT INTO games(round) VALUES('$ROUND')")

I don’t see that there would be any instruction in the students insert data script that would prevent this from happening there, yet it doesn’t.
I guess I could circumvent the problem by inserting all variables in a single statement at the end of the loop, but I’d still like to understand why this is happening.
Thx for any ideas!

That was an outdated version of the script, I had meanwhile removed the quotes from $YEAR