title: php displaying all db records in smarty tpl
body: <p>I want to create an array and assign it to smarty template to display all of my news. But the problem is it is only picking up the first row of data in the table, how can I fix this? It is only showing the first ever row and ther eis 4 rows in the database</p>
  
  <p>I am using mysqli for db driver...</p>
  
  <pre><code>$newsArray = array();
          $row = autoLoader::getLibrary('database')-&gt;query("SELECT * FROM `cms_news`")-&gt;fetch_array();
              $newsArray[] = $row;
  
          $this-&gt;smarty-&gt;assign('website_news', $newsArray);
  </code></pre>
  
  <p>Then I display it using this code in the tpl</p>
  
  <pre><code>{section name=nr loop=$website_news} 
     {$website_news[nr].id} 
     {$website_news[nr].title} 
     {$website_news[nr].shortstory}&lt;br /&gt; 
  {sectionelse} 
     &lt;h1&gt;No news found!&lt;/h1&gt; 
  {/section} 
  </code></pre>