title: Codeigniter : Retriving data between two dates from database
body: <p>How can I retrieve data from the database by querying records between two dates using codeigniter?</p>
  
  <p>Here is my code :</p>
  
  <pre><code>   function date_employee_details($id,$fdate,$sdate)
     {
      $this-&gt;db-&gt;select('*');
      $this-&gt;db-&gt;where('user_id',$id);
      $this-&gt;db-&gt;where('dates &gt;=',$fdate);
      $this-&gt;db-&gt;where('dates &lt;=',$sdate);
      return $this-&gt;db-&gt;get('attendance');
      }
  </code></pre>
  
  <p>but i got an error : </p>
  
  <pre><code>A PHP Error was encountered
  Severity: Notice
  Message: Undefined variable: fdate
  Filename: models/admin.php
  Line Number: 726
  </code></pre>
  
  <p>thanks</p>