title: sql update codeigniter
body: <p>I am using codeIgniter..
  I want to update a table column <code>is_close</code> when <code>id=$ticket_id</code> of my <code>table= tbl_tickets.</code>
  I am doing this :-</p>
  
  <pre><code>$data=array(
              'is_close'=&gt;1
              );
          $this-&gt;db-&gt;where('id',$title_id);
          $this-&gt;db-&gt;update('tbl_tickets',$data);
  </code></pre>
  
  <p>and I have also done this :-</p>
  
  <pre><code>$sql = "UPDATE tbl_tickets SET is_close={1} WHERE id='$title_id'";
  $this-&gt;db-&gt;query($sql);
  </code></pre>
  
  <p>both are not working,i.e., my table is not updating the value to 1 and also no error is being shown in the broswer. :(</p>
  
  <p><strong>Edited: Included my model part :</strong></p>
  
  <pre><code>function setClosePost($title_id){
          $sql = "UPDATE tbl_tickets SET is_close=0 WHERE id='$title_id'";
          $this-&gt;db-&gt;query($sql);
          // $data=array(
          //     'is_close'=&gt;1
          //     );
          // $this-&gt;db-&gt;where('id',$title_id);
          // $this-&gt;db-&gt;update('tbl_tickets',$data);
       }
  </code></pre>
  
  <p>My controller :-</p>
  
  <pre><code>function closePost(){
          $this-&gt;load-&gt;model('helpdesk_model');
          $this-&gt;helpdesk_model-&gt;setClosePost($this-&gt;input-&gt;post('title_id'));
        }
  </code></pre>