- Joined
- 14 Apr 2004
- Posts
- 11,888
- Location
- UK

Right guys, I'm having a problem with deleting users. Basically, I have an ID which you select and when I press delete, the page refreshes but no member is deleted from the database.
Below is the php for the button, checkbox and the delete command:
Code:
<input class="button" name="delete" type="submit" id="delete" value="delete">
---------------------------------------------------------------------------
<td align="center" bgcolor="#000000"><input name="checkbox[]" type="checkbox" id="checkbox[]" value="<? echo $rows['id']; ?>"></td>
---------------------------------------------------------------------------
<?
// Check if delete button active, start this
if($delete){
for($i=0;$i<$count;$i++){
$del_id = $checkbox[$i];
$sql = "DELETE FROM $tbl_name WHERE id='$del_id'";
$result = mysql_query($sql);
}
// if successful redirect to delete_multiple.php
if($result){
echo "<meta http-equiv=\"refresh\" content=\"0;URL=deleteuser.php\">";
}
}
mysql_close();
?>
