sngumo Posted July 20, 2008 Share Posted July 20, 2008 Hi, I have this problem I have a PHP page which generates a table with multiple rows, each with a given query result. Example: Id. Name Email Age Level 1 Martin [email protected] 27 user 2 Tom [email protected] 25 manager 3 Alex [email protected] 26 user Now I would like to put a checkbox next to each of the rows so that I can select multiple rows and process them at once if maybe I wanted to delete them or perform any other processing on the selected rows. How can I achieve this? Thanks in advance Link to comment https://forums.phpfreaks.com/topic/115680-processing-multiple-checkbox-selections-php/ Share on other sites More sharing options...
Barand Posted July 20, 2008 Share Posted July 20, 2008 on each row have a checkbox with a name ending with "[]" to create an array. Give each c/box a value of that rows id <input type='checkbox' name='cbox[]' value='{$row['id']}' /> To process, only checked values are posted, so $idlist = join (',', $_POST['cbox']); $sql = "SELECT name, email FROM table WHERE id IN ($idlist); Link to comment https://forums.phpfreaks.com/topic/115680-processing-multiple-checkbox-selections-php/#findComment-594733 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.