This should put you closer.
<form action="delete_notice.php" method="post">
<?
$query = mysql_query("SELECT title, id FROM notices");
$numrows = mysql_num_rows($query);
while($query2 = mysql_fetch_array($query))
{
?>
<input name="data" id="data" value="<? echo ".$query2[id]."; ?>" type=checkbox>
<?
echo ".$query2[title].";
print '
';
}
?>
<input type="submit" value="Delete selected">
</form> <?
$id = $_POST['id'];
$link = mysql_connect("localhost", $dbuser, $dbpass) or die ("Database Error: Couldn't Connect!");
mysql_select_db($dbname, $link) or die ("Couldn't open $dbname!");
$query = "DELETE FROM notices WHERE 'id' = '$data'";
mysql_query($query, $link) or die ("Couldn't delete data!");
mysql_close($link);include "header.php";print '<center>';
print '
';
print 'Notice(s) succesfully deleted';
print '
';
print '<a href="noticeadmin.php">Return to Notices Administration</a>';
print '<center>';
?>$query = "DELETE FROM notices WHERE 'id' = '$data'";
This is the only line I changed. You need to put that in a while loop and process the array that will now be created.
data[0]
data[1]
data[2]
etc etc etc...
might even want to try this
$dbuser = "username";
$dbpass = "password";
$link = mysql_connect("localhost", $dbuser, $dbpass) or die ("Database Error: Couldn't Connect!");
mysql_select_db($dbname, $link) or die ("Couldn't open $dbname!");
$query = mysql_query("DELETE FROM notices WHERE 'id' = '$data' LIMIT 1");It can work. I did it for my messenger. If you realy want me to show you let me know. Check my forms. Get an account at
http://www.tradebikes.com and message me. View the source and look at my checkbox HTML and compare to yours. I think I needed a for loop.