troubleshooting Question

inserting form data into Data base using coldfusion 9

Avatar of khan02
khan02Flag for United States of America asked on
ColdFusion Language
8 Comments1 Solution394 ViewsLast Modified:
Hi, i have a simple form with few users and their role. I want to insert all selected roles into my data base table. I am not sure how to do that.

see the code below:

<form id="contactform" name="contactform" action="role_act.cfm" method="post" class="cssform">
                <legend>Add Other Role(s):</legend>
                <input type="hidden" name="course_id" value="#num#">
                <cfloop query="qListAllPrgCont">
                 <div class="box_2">
                     <input type="hidden" name="contact_id" value="">
                     #qListAllPrgCont.first_name# #qListAllPrgCont.last_name# :
                          <input type="checkbox" name="role_id" value="3">Moderator
                          <input type="checkbox" name="role_id" value="4">super                  
                 <input type="submit" name="submit" value="Add Roles" class="button">

in my data base table i have a table named Contact_Role and i have fields as

Id | Contact_ID | Role_id |Course_ID

when i submit my form i want to insert these data one row at a time. so, i believe i need to construct some sort of array to hold these data. How can i do that?

Our community of experts have been thoroughly vetted for their expertise and industry experience.

Join our community to see this answer!
Unlock 1 Answer and 8 Comments.
Start Free Trial
Learn from the best

Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.

Andrew Hancock - VMware vExpert
See if this solution works for you by signing up for a 7 day free trial.
Unlock 1 Answer and 8 Comments.
Try for 7 days

”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.

-Mike Kapnisakis, Warner Bros