I've got a function who return me in json a large quantity of data. It was working good but today, an wild error appear. I have this string `}]},"2":{"trainid` instead of this `}]},{"trainid`

There is `"2":` out of nowhere, don't know where it come from.

Here is my code (kind of)

```
$return_list = array();
$query = "SELECT * from train_users"
if($result = $mysqli->query($query)) {
  while($row = $result->fetch_assoc()) { 
    $trainlist = array();

    $query2 = "Select * FROM train WHERE train_users_id = ".$row['id_user'];
            if($result2 = $mysqli->query($query2)) {
                while($row2 = $result2->fetch_assoc()) { 
                    $poollist[] = $row2['trainid'];
                }
            }
    for($i = 0;  $i < count($finalPoolList) ; $i++) {
        $query2 = "Select * FROM trainpassengers WHERE trainid = ".$row['id_user'];
            if($result2 = $mysqli->query($query2)) {
                while($row2 = $result2->fetch_assoc()) { 
                    $row['train'][$i] = $rowPool;
                }
            }
    }
    $return_list[] = $row;
  }
}

```

Another kind of same error was this : 

`"trains":{"1":{`

instead of this : 

`"trains":[{`

`{"1":` replaces `[`, don't know why