After executing a fetch query I get a result array:
[row_choice] => Array ( [0] => Array ( [id] => 277410 [text_value] =
You should create a new array variable as below.
$recArr = array(); while ($records = mysqli_fetch_array($query)) { $recArr[$records['id']] = $records; } var_dump($recArr);
Good luck.