| Delete row with Checkbox; Delete records in admin centre | |
|---|---|
| Tweet Topic Started: Jul 7 2008, 10:08 AM (119 Views) | |
| skinbug | Jul 7 2008, 10:08 AM Post #1 |
|
Hi guys, wandering if anyone had any suggestions on how to complete this... I'm stuck as hell... In admin_functions.php, when echoing the table, I created 2 more table heads at the start called Select and Action Then, when echoing the results, the first td is a checkbox, the second is a button..... So th Select has a td of checkbox, and th Action has a td of a button for ever record in the database. ___ then in adminprocess.php, there is a function of procDeleteUser which I'm stuck on... I've looked at loads of tutorials on the web about deleting with a checkbox but can't seem to intergrate any of them. Anyone have any ideas on how this might be achieved?? Cheers |
![]() |
|
| skinbug | Jul 7 2008, 11:08 AM Post #2 |
|
The only info I can give is that the checkbox needs to be in some sort of array, eg, name='delete[]' I also gave it a value of this....value=' ".$i['id']." ' then so far, function procDeleteUser is as follows... function procDeleteUser() { global $session, $database, $form; if(isset($_POST['delete'])) { $q = "DELETE FROM ".TBL_USERS." WHERE username='$id'"."AND userlevel != ".ADMIN_LEVEL; $database->query($q); header("Location: ".$session->referrer); } } It doesn't work
|
![]() |
|
| 1 user reading this topic (1 Guest and 0 Anonymous) | |
| « Previous Topic · Other · Next Topic » |





12:49 AM Jul 11