I have an online system with many courses. I would like to insert a course_id for as many courses that are selected.
I'm using email address as the PK and the table that it should insert to will contain the following: h_email, course_id
The following is the insert loop I've set up in the action page:
<cfquery datasource="seligins">
INSERT INTO tblRegistration_details
(h_email, course_id)
VALUES
<cfloop index="i" to list="#Form.fieldnames#">
(#Form.h_email#, #Form.course_id#)
</cfloop>
</cfquery>
Can someone help me finish this code.
The way it should work is that if someone is registering for 3 courses those courses will be inserted as
test@mail.com, course001
test@mail.com, course201
test@mail.com, course003
Thanks in advance for any help.

I'm using email address as the PK and the table that it should insert to will contain the following: h_email, course_id
The following is the insert loop I've set up in the action page:
<cfquery datasource="seligins">
INSERT INTO tblRegistration_details
(h_email, course_id)
VALUES
<cfloop index="i" to list="#Form.fieldnames#">
(#Form.h_email#, #Form.course_id#)
</cfloop>
</cfquery>
Can someone help me finish this code.
The way it should work is that if someone is registering for 3 courses those courses will be inserted as
test@mail.com, course001
test@mail.com, course201
test@mail.com, course003
Thanks in advance for any help.