ShoeLace1291 Posted June 10, 2007 Share Posted June 10, 2007 If I'm looping a database query and displaying the results, how do I delete the results where a checkbox next to it is checked? Link to comment https://forums.phpfreaks.com/topic/54920-delete-database-result-with-checkbox/ Share on other sites More sharing options...
soycharliente Posted June 10, 2007 Share Posted June 10, 2007 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. Link to comment https://forums.phpfreaks.com/topic/54920-delete-database-result-with-checkbox/#findComment-271620 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.