title: Get month and year with this->db->where on codeigniter
body: <p>still problematic in my project . My own previous posts but no answer . I would like to call the Year and month of the mysql database of the results of the data POST.</p>
  
  <p>This my controllers</p>
  
  <pre><code>public function report(){
  $nomor = $this-&gt;input-&gt;post('nomor_reseller');
  $bulan = $this-&gt;input-&gt;post('month'); // YYYY-MM
  
  $report_data = $this-&gt;hasil_m-&gt;get_data($nomor, $bulan );
  }
  </code></pre>
  
  <p>if only the month who called her work but if I enter the year and month did not work</p>
  
  <p>This my models</p>
  
  <pre><code>function get_data($nomor,$bulan) {
      $this-&gt;db-&gt;select('*');
      $this-&gt;db-&gt;from('tb_pelanggan as pel');
      $this-&gt;db-&gt;join('tb_produk as pro', 'pel.id_barcode  = pro.id_barcode');    
      $this-&gt;db-&gt;select_sum('jumlah');
      $this-&gt;db-&gt;where('MONTH(pel.tgl_pembelian)',$bulan);
      $this-&gt;db-&gt;group_by('pel.id_barcode');
      $query = $this-&gt;db-&gt;get();
      if ($query-&gt;num_rows() &gt; 0) {
          return $query-&gt;result();
          } else {
          return false;
      }
  }   
  </code></pre>