title: fetch data from database based on date
body: <p>This is my table fields
  <strong>table1 : cash_transactions</strong>
  id
  dated_on
  amount
  from_user
  to_user
  trans_type
  userid
  purpose
  <strong>table2 : login</strong>
  loginid
  name
  username
  password
  usertype
  status</p>
  
  <p>Controller : Admin</p>
  
  <pre><code>public function daily_report()
  {
      $daily_date=date('Y-m-d');
      $data['fetch']= $this-&gt;admin-&gt;get_daily_report($daily_date);
      $this-&gt;load-&gt;view('daily_report',$data);
  
  }
  </code></pre>
  
  <p>Model: Admin_Model</p>
  
  <pre><code>public function get_daily_report($daily_date)
  {
      $this-&gt;db-&gt;select('c.userid,c.amount,c.trans_type,c.from_user,c.to_user,c.purpose,l.loginid,l.name');
      $this-&gt;db-&gt;from('cash_transactions as c');
      $this-&gt;db-&gt;join('login as l', 'c.userid = l.loginid');
      $this-&gt;db-&gt;where('c.dated_on',$daily_date);
      $query = $this-&gt;db-&gt;get();
      $result =$query-&gt;result();
      return $result;
  }
  </code></pre>
  
  <p>Here i want to fetch the current date data from the database, but this is not working. Please solve this problem.</p>