title: Datatables requested unknown parameter '0' for row 0
body: <p>I've got this problem when i try to get data from clients table in the database</p>
  
  <p><strong>DataTables warning: table id=example - Requested unknown parameter '0' for row 0. For more information about this error, please see <a href="http://datatables.net/tn/4" rel="noreferrer">http://datatables.net/tn/4</a></strong></p>
  
  <p>This is my Controller in Codeigniter</p>
  
  <pre><code>class Clients extends CI_Controller  {
  
      function header()
      {
          $data['hms'] = $this-&gt;config-&gt;item('page_title');
          $this-&gt;load-&gt;view('header3',$data);
      }
  
      public function index()
      {
  
          //$this-&gt;datatables-&gt;select('*');
          //$this-&gt;datatables-&gt;from('bookitguests');
          //$data['clients'] = $this-&gt;datatables-&gt;generate();
          $data = "";
          $this-&gt;header();
          $this-&gt;load-&gt;view('all_guests',$data);
      }
  
      public function TableClients()
      {
          $this-&gt;datatables-&gt;select('name, surname, email')-&gt;from('bookitguests');
          echo $this-&gt;datatables-&gt;generate();
      }
  
  }
  </code></pre>
  
  <p>This is my view in Codeigniter (ps, im not adding the header file, its too long)</p>
  
  <pre><code>&lt;!-- DataTables CSS --&gt;
  &lt;link rel="stylesheet" type="text/css" href="//cdn.datatables.net/1.10.1/css/jquery.dataTables.css"&gt;
  &lt;!-- jQuery --&gt;
  &lt;script type="text/javascript" charset="utf8" src="//code.jquery.com/jquery-1.10.2.min.js"&gt;&lt;/script&gt;
  &lt;!-- DataTables --&gt;
  &lt;script type="text/javascript" charset="utf8" src="//cdn.datatables.net/1.10.1/js/jquery.dataTables.js"&gt;&lt;/script&gt;
  &lt;script type="text/javascript" language="javascript" charset="utf-8"&gt;
      $(document).ready(function() {
          $('#example').DataTable( {
              "bProcessing": false,
              "bServerSide": false,
              "sAjaxSource": "&lt;?php base_url(); ?&gt;clients/TableClients",
              "sServerMethod": "POST"
          } );
      } );
  &lt;/script&gt;
  
  &lt;div id="container"&gt;
      &lt;h1&gt;All Clients&lt;/h1&gt;
  
      &lt;div id="body"&gt;
          &lt;table id="example" class="display"&gt;
              &lt;thead&gt;
              &lt;tr&gt;
                  &lt;th&gt;Name&lt;/th&gt;
                  &lt;th&gt;Surname&lt;/th&gt;
                  &lt;th&gt;Email&lt;/th&gt;
              &lt;/tr&gt;
              &lt;/thead&gt;
              &lt;tbody&gt;
              &lt;/tbody&gt;
          &lt;/table&gt;
      &lt;/div&gt;
      &lt;p class="footer"&gt;Page rendered in &lt;strong&gt;{elapsed_time}&lt;/strong&gt; seconds&lt;/p&gt;
  &lt;/div&gt;
  &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>