下面是我在非 codeigniter 代码工作中制作的 php 代码。这是一个全选和取消全选删除功能。如果它在控制模型或视图中,我不确定该放在哪里?谁能帮帮我吗。
<?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?\">"; }
}
?>