title: where clause for datatable in codeigniter not working
body: <p>I'm trying to make simple datatable, It's completely okay with out the where clues but I need the where clue to work "$this->db->where('user.user_id', $this->session->userdata('user_id'));". Please help me to fine out whats going wrong here.</p>
  
  <pre><code>class Dashboard_model extends CI_Model{
      var $table = "todo";
      var $select_column = array("todo_id", "todo.user_id", "login", "content");
      var $order_column = array(null, "login", "content");
      public function make_query(){
          $this-&gt;db-&gt;select($this-&gt;select_column);
          $this-&gt;db-&gt;join('user', $this-&gt;table.'.user_id = user.user_id');
          $this-&gt;db-&gt;where('user.user_id', $this-&gt;session-&gt;userdata('user_id'));
          $this-&gt;db-&gt;from($this-&gt;table);
          if (isset($_POST["search"]["value"])){
              $this-&gt;db-&gt;like("login", $_POST["search"]["value"]);
              $this-&gt;db-&gt;or_like("content", $_POST["search"]["value"]);
          }
          if (isset($_POST["order"])){
              $this-&gt;db-&gt;order_by($this-&gt;order_column[ $_POST['order']['0']['column'] ], $_POST['order']['0']['dir']);
          }else{
              $this-&gt;db-&gt;order_by("todo_id", "DESC");
          }
      }
      public  function make_datatables(){
          $this-&gt;make_query();
          if ($_POST["length"] != -1){
              $this-&gt;db-&gt;limit($_POST["length"], $_POST["start"]);
          }
          $query = $this-&gt;db-&gt;get();
          return $query-&gt;result();
      }
      public function get_filtered_data(){
          $this-&gt;make_query();
          $query = $this-&gt;db-&gt;get();
          return $query-&gt;num_rows();
      }
      public function get_all_data(){
          $this-&gt;db-&gt;select("*");
          $this-&gt;db-&gt;from($this-&gt;table);
          return $this-&gt;db-&gt;count_all_results();
      }
  }
  </code></pre>