Welcome Guest, Not a member yet? Register   Sign In
How to handle this code into codeigniter?
#1

[eluser]Unknown[/eluser]
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.
Code:
<?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 "&lt;meta http-equiv=\"refresh\" content=\"0;URL=notification.php?\"&gt;"; }

}

/*End of Checkbox Commands*/
?&gt;




Theme © iAndrew 2016 - Forum software by © MyBB