Jump to content

Delete Database result with Checkbox


ShoeLace1291

Recommended Posts

Put the checkbox in a form, give it a name, check for it being selected in the $_POST array, then delete if it's checked. Something like...

<?php
if(isset($_POST["checkboxforusernamedcharlie"]) { 
$foo = $_POST["checkboxforusernamedcharlie"];
$query = "DELETE FROM table WHERE user='$foo'";
?>

 

That's how I'd go about it.

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.