title: How to delete data with 2 parameters (WHERE...AND) in CodeIgniter
body: <p>I have a little problem, I want to delete data by 2 where conditions, maybe I did something wrong in my view</p>
  
  <p>I try to delete data by <code>id_user</code> and <code>id_produk</code></p>
  
  <pre><code> //this is my view
  
  &lt;?php $rows = $this-&gt;db-&gt;query("SELECT * FROM V_cart where id_user='".$this-&gt;session-&gt;id_user."'")-&gt;result_array();{?&gt;
                                  &lt;?php foreach($rows as $cr):?&gt;
                                      &lt;tr&gt;
                                          &lt;td class=""&gt;&lt;img style="width:100px;" src="&lt;?= base_url('assets/images/produk/').$cr['foto'];?&gt;" alt="product img"&gt;&lt;/a&gt;
                                          &lt;td class="product-name"&gt;&lt;?= $cr['nama_produk'];?&gt;&lt;/td&gt;
                                          &lt;td class="product-price"&gt;&lt;?= $cr['harga'];?&gt;&lt;/td&gt;
                                          &lt;td class="product-price"&gt;&lt;?= $cr['ukuran'];?&gt;&lt;/span&gt;&lt;/td&gt;
                                          &lt;input type="hidden" name="harga" value="&lt;?= $cr['harga'];?&gt;"&gt;
                                          &lt;td&gt;&lt;input name="jumlah" type="number" min='1' value="&lt;?= $cr['jumlah'];?&gt;"&gt; &lt;/td&gt;       
                                          &lt;td id="amount" class="product-subtotal"&gt;&lt;?= $cr['total_harga'];?&gt;&lt;/td&gt;    
                                          &lt;td class=""&gt;&lt;a href="&lt;?php echo base_url();?&gt;user/del_cart/&lt;?=$id=$cr['id_produk'];?&gt;" href="&lt;?php echo base_url();?&gt;user/del_cart/&lt;?=$id=$this-&gt;session-&gt;id_user;?&gt;"  name="submit" style="color:#fff;" class="btn btn-small btn-danger" &gt;&lt;i class="fa fa-trash"&gt;&lt;/i&gt;&lt;/a&gt;         
                                      &lt;/tr&gt;
                                      &lt;?php endforeach;?&gt;   
                                      &lt;?php } ?&gt;
                                  &lt;/tbody&gt;
  </code></pre>
  
  <p>//this is my controller</p>
  
  <pre><code>     public function del_cart($id){
             $where=array(['id_user'=&gt;$id],['id_produk'=&gt;$id]); var_dump($where);
             $this-&gt;M_admin-&gt;del_cart($where,'tbl_cart');
             $this-&gt;session-&gt;set_flashdata('notif','&lt;div class="alert alert-primary" role="alert"&gt; &lt;strong&gt;Data Berhasil dihapus! &lt;/strong&gt; &lt;button type="button" class="close" data-dismiss="alert" aria-label="Close"&gt;&lt;span aria-hidden="true"&gt;&amp;times;&lt;/span&gt;&lt;/button&gt;&lt;/div&gt;');
             redirect('user/cart');
          }
  </code></pre>
  
  <p>//and this is my model</p>
  
  <pre><code>function del_cart($where,$table){
      $this-&gt;db-&gt;where($where);
      $this-&gt;db-&gt;delete($table);
  }
  </code></pre>
  
  <p>I want to delete data by 2 parameters, <code>id_user</code> and <code>id_produk</code>.</p>