Ver original$out = []; while ($fila = $result->fetch_array()){ $out []= $fila['Total'];} echo join(', ', $out);