title: mysqli_fetch_array while loop columns
body: <p>Should be pretty basic, but I can't get it to work. I have this code to iterate over a mysqli query:</p>
  
  <pre><code>while($row = mysqli_fetch_array($result)) {
      $posts[] = $row['post_id'].$row['post_title'].$row['content'];
  }
  </code></pre>
  
  <p>It works and returns:</p>
  
  <blockquote>
    <p>Variable #1:   (Array, 3 elements) ↵
         0 (String): "4testtest" (9 characters)
         1 (String): "1Hello world!Welcome to WordPress. This is your first post. Edit or delete it, then start blogging!" (99 characters)
         2 (String): "2Sample PageThis is an example page. It's different from a blog post because it will stay in one place and will show up in
    your site navigation (in most themes)." (161 characters)</p>
  </blockquote>
  
  <p>The problem is that it puts all three colums into one column, so I can't access them seperatly. </p>
  
  <p>This for example: </p>
  
  <blockquote>
    <p>0 (String): "4testtest" (9 characters)</p>
  </blockquote>
  
  <p>Should be seperated into 4, test, test</p>
  
  <p>When I do this:</p>
  
  <pre><code>while($row = mysqli_fetch_array($result)) {             
      $posts['post_id'] = $row['post_id'];
      $posts['post_title'] = $row['post_title'];
      $posts['type'] = $row['type'];
      $posts['author'] = $row['author'];  
  }   
  </code></pre>
  
  <p>It only outputs 1 row instead of all three …</p>
  
  <p>Any help is greatly appreciated!</p>