hmm still not working
what it is part of is an inventory page where there are checkboxes for each item you own and a delete button and im trying to get it so that when you click the delete button everything that is selected is deleted
here is the whole code for you
$deleted = $_GET['delete'];
if(isset($deleted)){
foreach($deleted as $dId){
$delete = mysql_query("delete from items where itemid = ".(int)$dId."") or die('crap'); //Adding an (int) will help avoid SQL errors
}
}
$result = mysql_query("select itemid, item from items where userid = ".(int)$_SESSION['id']) or die('summit went wrong');
$count = mysql_num_rows($result);
if($count <1){
print("<tr><td colspan=\"3\"><center>You currently have no items.<center></td></tr>");
}else{
while($item = mysql_fetch_array($result)){
print("<tr><td><center>".$item['item']."</center></td><td width=\"40%\"><center>".$item['itemid']."</center></td><td width=\"10$\">
<input type=\"checkbox\" name=\"delete[]\" value=".$item['itemid'].">
</td></tr>
");
}
print("<tr><td colspan='3'><p align='right'><input type='submit' name='delete' id='delete' value='delete!'</p></td></tr>");
}