Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

checkboxes and insert - Help......

New Here ,
Nov 28, 2008 Nov 28, 2008
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)>
TOPICS
Getting started
345
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Valorous Hero ,
Nov 28, 2008 Nov 28, 2008
LATEST
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Resources