A way always exists 🙂
If I get you right you need to print some rows from the database with one group in each line
and want to do some processing to groups separately.
You can use separate form for each row and use some hidden value within it that indicate which row is used.
Example of HTML below (without table tags - just to show the way):
<form action="groups.php" method="post">
Row1
Group Name
Users in group
<input type=hidden name="rowid" value="1">
<select name="select">
<option value="1">Show users</option>
<option value="2">Delete Group</option>
</select>
<input type="submit" name="submit" value="go">
</form>
<form action="groups.php" method="post">
Row2
Group Name
Users in group
<input type=hidden name="rowid" value="2">
<select name="select">
<option value="1">Show users</option>
<option value="2">Delete Group</option>
</select>
<input type="submit" name="submit" value="go">
</form>
And PHP code is:
if( $_POST['submit'] ) {
$rowid = (int)$_POST['rowid'];
if( $_POST['select'] == 1 ) {
echo 'Show all users selected for row'.$rowid;
} elseif( $_POST['select'] == 2 ) {
echo 'Delete group selected for row'.$rowid;
}
}
Hope you got the idea