Welcome Guest [Log In] [Register]
Add Reply
Delete row with Checkbox; Delete records in admin centre
Topic Started: Jul 7 2008, 10:08 AM (119 Views)
skinbug

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
Offline Profile Quote Post Goto Top
 
skinbug

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 :(
Offline Profile Quote Post Goto Top
 
1 user reading this topic (1 Guest and 0 Anonymous)
« Previous Topic · Other · Next Topic »
Add Reply