EllisLab text mark
Advanced Search
     
How to handle this code into codeigniter?
Posted: 14 October 2012 02:33 PM   [ Ignore ]
Joined: 2012-10-08
1 posts

I’m not sure where to post this, but i need your help.

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.

<?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<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 
"<meta http-equiv=\"refresh\" content=\"0;URL=notification.php?\">"}
 
}

/*End of Checkbox Commands*/
?>