title: How do I iterate over the results in a MySQLi result set?
body: <p>I want to loop through the result set of the following query:</p>
  <pre><code>select uid from userbase
  </code></pre>
  <p>I am currently employing the following loop, but I can get only the first value.</p>
  <pre><code>$i = 0;
  $output = mysqli_query($mysqli, &quot;select uid from userbase&quot;);
  while ($row = $output-&gt;fetch_array()) {
      $deviceToken = $row[$i];
      echo $deviceToken;
      $i++;
  }
  </code></pre>
  <p>What might be the problem? Is it <code>fetch_array()</code>?</p>