<?php if (isset($_POST['Submit'])) {
foreach ($_POST['todelete'] as $delete_id) {
$query = "DELETE FROM news WHERE NewsID = $delete_id";
mysql_query($query, $som) ;
}
echo 'News removed.<br />';
}
$query = "SELECT * FROM news";
$result = mysql_query($query, $som);
while ($row = mysql_fetch_array($result)) {
echo '<input type="checkbox" value="' . $row['NewsID'] . '" name="todelete[]" />';
echo $row['Headline'];
echo '<br />';
} ?>
|