title: Select multiple rows from MySQL
body: <p>I have a MySQL table:</p>
  <pre><code>id     header     content
  -------------------------
  10     test3      &lt;p&gt;test&lt;/p&gt;
  9      test2      &lt;p&gt;test&lt;/p&gt;
  8      test       &lt;p&gt;test&lt;/p&gt;
  </code></pre>
  <p>but when I run this code:</p>
  <pre><code>$sql = &quot;SELECT * FROM posts&quot;;
  $query = mysqli_query($db_conx, $sql);
  
  if($query) {
      $row = mysqli_fetch_row($query);
      for($i; $i &lt; count($row); $i++){
          echo $row[$i] . &quot; &quot;;
      }
  }
  </code></pre>
  <p>it only selects the first row.</p>
  <p>My ideal output would by an array that looks like:</p>
  <pre><code>$dataArray[0][0] = &quot;10&quot;
  $dataArray[0][1] = &quot;test3&quot;
  $dataArray[0][2] = &quot;&lt;p&gt;test&lt;/p&gt;&quot;
  
  $dataArray[1][0] = &quot;9&quot;
  $dataArray[1][1] = &quot;test2&quot;
  $dataArray[1][2] = &quot;&lt;p&gt;test&lt;/p&gt;&quot;
  
  $dataArray[2][0] = &quot;8&quot;
  $dataArray[2][1] = &quot;test&quot;
  $dataArray[2][2] = &quot;&lt;p&gt;test&lt;/p&gt;&quot;
  
  etc;
  </code></pre>
  <p>What is the correct way to select multiple rows?</p>