title: codeigniter update ticket_status field with value "2" if one of the is_approved=1 based on orderid
body: <p>This is <strong>request</strong> table</p>
  
  <p><a href="https://i.stack.imgur.com/NWT4y.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/NWT4y.png" alt="enter image description here"></a></p>
  
  <p>how can i update ticket_status field with value "2" if <strong>one of</strong> or  <strong>atleast</strong> if  is_approved=1 based on orderid</p>
  
  <p><strong>This is what i have tried so for but it cant fill up all ticket status for respective orderid</strong></p>
  
  <p><strong>This my Controller</strong></p>
  
  <pre><code>function pend_request($orderid){
          $this-&gt;load-&gt;model('request');
          $this-&gt;session-&gt;set_flashdata('message', 'order successfully pended');
          $this-&gt;request-&gt;pend_request($orederid);
          redirect('admin/Requests', 'refresh');
      }
  </code></pre>
  
  <p><strong>This is my Model</strong></p>
  
  <pre><code> function pend_request($orderid)
      {
          $this-&gt;db-&gt;set('ticket_status', "2");
          $this-&gt;db-&gt;where('orderid', $orderid);
          $this-&gt;db-&gt;update('requests');
      }
  </code></pre>
  
  <p><strong>This is my View</strong></p>
  
  <pre><code> &lt;?php
         foreach($requests as $request):
      endforeach;
      if($request-&gt;is_approved == 1){?&gt;
       &lt;li&gt;
  &lt;a href="&lt;?php echo base_url('admin/requests/pend_request/'.$request-&gt;orderid); ?&gt;" class="btn btn-xs  btn-warning"&gt;&lt;span class="icon-minus" style="color:blue"&gt;&lt;/span&gt; pend&lt;/a&gt;
   &lt;/li&gt;
     &lt;?php }
  else{}
  
      ?&gt;
  </code></pre>