Oracle Sql Loop Through Array Php Functions