How do you do bulk deletion in PHP? Find the Code
I've been working on a project recently, but the bulk deletion has never worked. I put the code on the following, you Daniel help me to see where the problem is, and then thank you!
1. Bulk deletion
if ($_post["CHK"]) {
$sid = Implode (",", $_post["chk"]);
$query = mysql_query ("Delete from news where news_id in (". $sid. ")");
if ($query) {
echo "";
}
else {
echo "";
}
}
This method how to delete also not, there are sometimes the cancellation can also delete, do not know why, ask the expert to answer.
------Solution--------------------
The SQL statement echo out to see exactly what is being executed, not to think of other solutions
------Solution--------------------
This problem is easy to solve, the $_post["chk"] printing, the SQL statement printing problem solved
------Solution--------------------
I suggest you put all your code on it.
------Solution--------------------
echo "";
Your checkbox does not give value.
------Solution--------------------
The point of cancellation can also be deleted because this sentence is to write:
There is also the Del () function:
if (num==0) {
Alert ("Please choose!");
return false;
}