I needed a code to allow for multiple line deletion. I found this code, and thought I had it implemented properly, but it doesn't delete the checked line.
Can someone tell me what is wrong?
Thanks,
On the first page, I have:
<?php
function LoanProgram() {
global $table_us_schools;
$resultSet = mysql_query("SELECT ID,SchoolName,StateCode,SchoolCode
FROM $table_us_schools
ORDER BY SchoolName");
while (list($ID,$SchoolName,$StateCode,$SchoolCode) =
mysql_fetch_array($resultSet)) {
echo("<tr>
<td class=\"text12blk\">$SchoolName</td>
<td class=\"text12blk\">$StateCode</td>
<td class=\"text12blk\">$SchoolCode</td>
<td> </td>
<td class=\"text12blk\"><input type=\"checkbox\" name='DeleteItems[]' value=\"$ID\"></td>
</tr>");
}
}
LoanProgram()
?>
------On the second, receiving page:------
<?php
$csvID = implode($DeleteItems, ",");
$DeleteQuery = "DELETE FROM $table_us_schools
WHERE ID IN($csvID)";
echo"<div class=text12red>The Following Schools were deleted from the database:</div>
<div class=text10>$csvID</div>";
?>
Thanks,
Brett Taylor