title: SELECT with LIMIT in Codeigniter
body: <p>I have a site develop in Codeigniter, and in my model I have a function like this:</p>
  
  <pre><code>function nationList($limit=null, $start=null) {
      if ($this-&gt;session-&gt;userdata('language')=="it")
      $this-&gt;db-&gt;select('nation.id, nation.name_it as name');
      if ($this-&gt;session-&gt;userdata('language')=="en")
      $this-&gt;db-&gt;select('nation.id, nation.name_en as name');
      $this-&gt;db-&gt;from('nation');
      $this-&gt;db-&gt;order_by("name", "asc");
      $this-&gt;db-&gt;limit($limit, $start);
      $query = $this-&gt;db-&gt;get();
      $nation = array();
      foreach ($query-&gt;result() as $row)
          array_push($nation, $row);
  
      return $nation;     
  }
  </code></pre>
  
  <p>And if into my controller I call the function without limit and start doesn't return result like this:</p>
  
  <pre><code>$data["nationlist"] = $this-&gt;Nation_model-&gt;nationList();
  </code></pre>
  
  <p>Instead if I set limit and start works!
  If limit and start are null, Why doesn't return result? I don't want to make a second function or a control if limit and start are null.
  How can I solve this when limit and start are null without a control or a second function to make useful the code and more efficient? </p>