title: PHP - Echo All Results From MySQL SELECT Query
body: <p>I have a PHP script that executes a MySQL SELECT query, and I would like to echo each row from that query to the page. I have tried multiple methods to go about doing this, but none seems to work. The most reasonable of these ways that I have come up with is provided below, but it doesn't work either.</p>
  
  <pre><code>$result = $conn-&gt;query("SELECT count FROM countTable;") or trigger_error($conn-&gt;error);
  $row = $result-&gt;fetch_array(MYSQL_BOTH);
  $count = sizeof($row);
  for($i = 0; $i &lt;= $count; $i++)
  {
      echo $row[$i];
  }
  </code></pre>
  
  <p>The code provided above only prints the first row resulting form the query. How can I modify this code so that it prints the entirething?</p>