title: inserting data into database with condition/ codeigniter
body: <p>I am a beginner in CodeIgniter and I want to insert a data in codeigniter with a where clause. Something like a query like this:</p>
  
  <pre><code>insert into tbl_check_up (bill_id) values ("bill_id") where check_up_id = "'.$check_up_id.'" ;
  </code></pre>
  
  <p>how can i convert it into codeigniter</p>
  
  <p>Here is my codeigniter model: </p>
  
  <pre><code>var $tbl_check_up = 'tbl_check_up';
  
  public function save_bill_checkup($check_up_id,$data) {
          $this-&gt;db-&gt;insert($this-&gt;tbl_check_up,$data);
          return $this-&gt;db-&gt;insert_id();
      }
  </code></pre>
  
  <p>Here is my controller :</p>
  
  <pre><code>public function bill_id() {
       $check_up_id = $this-&gt;input-&gt;post('check_up_id');
       $data1 = array(
              'bill_id'   =&gt; $bill_id
           );
       $insert1 = $this-&gt;billing_model-&gt;save_bill_checkup($check_up_id,$data1);
  }
  </code></pre>