Over a million developers have joined DZone.

Assign Multiple Members To A Group

·
Assign multiple members pulled from a db table to a group.








Group List: "; $query2 = "SELECT address, group_id FROM members"; $result1 = mysql_query($query2); echo "

Member List: "; echo "

"; if ($_GET['a'] == 'add_members2group') { $group_id = $_POST['group_id']; $address_count = count($_POST['address']); $values = $_POST['address']; foreach( $_POST['address'] as $address) { $query = "UPDATE ".MYSQL_TBL_MAILLIST_SUBSCRIBERS." SET group_id='$group_id' WHERE address='$address'"; $result = mysql_query($query) or die("Error: ".mysql_error()); } echo "

$address_count Members have been added.

"; } ?>

Topics:

Opinions expressed by DZone contributors are their own.

The best of DZone straight to your inbox.

SEE AN EXAMPLE
Please provide a valid email address.

Thanks for subscribing!

Awesome! Check your inbox to verify your email so you can start receiving the latest in tech news and resources.
Subscribe

{{ parent.title || parent.header.title}}

{{ parent.tldr }}

{{ parent.urlSource.name }}