title: Codeigniter -> counting table numbers and show on the page
body: <p>I wanna show number of rows of table on my website.
  query is working on mysql page. it shows 1292.</p>
  
  <p>Model</p>
  
  <pre><code>function count_bookmark()
      {
          $query = 'SELECT COUNT(*) FROM T_BOOKMARK_HISTORY';
          $result = $this-&gt;db-&gt;query($query);
  
          if($result-&gt;num_rows() &lt;= 0)
              return FALSE;
          else{
              return TRUE;
          }
      }
  </code></pre>
  
  <p>Controller</p>
  
  <pre><code>$data['count'] = $this-&gt;admin_model-&gt;count_bookmark();
  </code></pre>
  
  <p>View</p>
  
  <pre><code>&lt;?=$count?&gt;
  </code></pre>
  
  <p>This only show number 1.</p>