I have a user interface and it has multiple checkboxes to select what members of a group a user is in. I have a table to store user information (USERS), a table to store the groups (GROUPS), and a join table to keep track of what group a user is a member of (GROUPMEMBERS). I set the NAME field of all the checkboxes to ffGroups and the VALUE for each of those checkboxes is populated with a different GROUP_ID. URL.USER_ID is the current user I'm editing. I have the following query to insert the users and groups into the join table:
INSERT INTO GROUPMEMBERS(USER_ID, GROUP_ID) SELECT '#Val(URL.USER_ID)#', GROUP_ID FROM GROUPS WHERE GROUP_ID IN (#ffGroups#) I don't get why it's not generating an error, though. '#Val(URL.USER_ID)#' does not exist in the GROUPS table. I tried making the following test query: <cfquery name="miketest"> SELECT '1', GROUP_ID FROM GROUPS </cfquery> and it threw an error, so I'm guessing because that SELECT statement replaces the VALUES portion of the INSERT statement, it lets it fly for some reason. Is this true? I was just curious... Thanks! Mike ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~| Message: http://www.houseoffusion.com/lists.cfm/link=i:4:228733 Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/4 Subscription: http://www.houseoffusion.com/lists.cfm/link=s:4 Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4 Donations & Support: http://www.houseoffusion.com/tiny.cfm/54