0
checkboxes and insert - Help......
New Here
,
/t5/coldfusion-discussions/checkboxes-and-insert-help/td-p/140052
Nov 28, 2008
Nov 28, 2008
Copy link to clipboard
Copied
I have 3 tables (locations, categories, location_categories)
I need to do an update and insert. Here are the three selects which
retrieves the checked categories. How can I do an insert / update
into the locations_categories table creating a record for each
checkbox that is checked. I know I need to do a loop on a list but
not sure how to write it. Here are my select statements.
<cfquery name="getlocations">
SELECT locationid, locname
FROM locations
</cfquery>
<cfquery name="getcategories">
SELECT categoryid, catname
FROM categories
</cfquery>
<cfquery name="loccatselected">
SELECT
categoryid
FROM location_categories
WHERE locationid=#URL.locationid#
</cfquery>
<cfset variables.selectedCategories=ValueList(loccatselected.categoryid)>
<cfquery name="getlocations">
SELECT locationid, locname
FROM locations
</cfquery>
<cfquery name="getcategories">
SELECT categoryid, catname
FROM categories
</cfquery>
<cfquery name="loccatselected">
SELECT
categoryid
FROM location_categories
WHERE locationid=#URL.locationid#
</cfquery>
<cfset variables.selectedCategories=ValueList(loccatselected.categoryid)>
TOPICS
Getting started
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting.
Learn more
Valorous Hero
,
LATEST
/t5/coldfusion-discussions/checkboxes-and-insert-help/m-p/140053#M12928
Nov 28, 2008
Nov 28, 2008
Copy link to clipboard
Copied
No need to double post.
http://www.adobe.com/cfusion/webforums/forum/messageview.cfm?forumid=1&catid=3&threadid=1408987
http://www.adobe.com/cfusion/webforums/forum/messageview.cfm?forumid=1&catid=3&threadid=1408987
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting.
Learn more

