title: How to handle this multiple delete functionality with check and uncheck code into codeigniter?
body: <p>Below is a php code i made in a non codeigniter code work. It is a check all and uncheck all delete function. i’m not sure where to put this if it’s in the control model or view? can anyone please help me.</p>
  
  <pre><code>&lt;?php
  
  /*Check Box Commands*/
  $id=$row_notification['user_id'];
  
  if(isset($_POST['Delete'])) {
  $checkbox = $_POST['checkbox'];
  mysql_select_db($database_connection_ched, $connection_ched);
  $id=$row_notification['user_id'];
  
  for($i=0;$i&lt;count($checkbox);$i++)
    {
  $delete = "DELETE FROM tb_user WHERE user_id=$checkbox[$i]";
  mysql_query($delete,$connection_ched);
  
  }
  $result2 = mysql_query($delete);
  
  if($result2)
  {
  echo "[removed]alert ('Successfully Deleted');[removed]"; 
  echo "&lt;meta http-equiv=\"refresh\" content=\"0;URL=notification.php?\"&gt;"; }
  
  }
  ?&gt;
  </code></pre>