Postgres Declare Array Php Use For Loop