Array Inside Array Php Functions Sql