Following is also not working
while ($row = $res->fetch_assoc()) {
if(!isset($temp_arr)) {
$temp_arr = $row;
} else {
$temp_arr = $temp_arr + $row;
}
}
OutPut : $temp_arr : First row in the array
And also
while ($row = $res->fetch_assoc()) {
if(!isset($temp_arr)) {
$temp_arr = array_merge($row);
} else {
$temp_arr = array_merge($temp_arr , $row);
}
}
OutPut : $temp_arr : Last row in the array