Skip to main content
Participant
October 5, 2009
Question

passing values from 2 tables

  • October 5, 2009
  • 1 reply
  • 388 views

Hello

this code

                         <p>Available Subject for this semester:
                              <select name="listsubject">
                                  <option value="other" selected>Select one</option>
                                  <cfloop query="qGetUsrDistrict">
                                    <option value="#qGetUsrDistrict.Subject_Name#">#qGetUsrDistrict.Subject_Name#</option>
                                    </cfloop>
                              </select>

was from

<cfquery name="qGetUsrDistrict" datasource="#Variables.fw.Config.DSN#">
    SELECT * FROM subject
</cfquery>

and i want to insert it into another cfm page, called register.cfm..

        <cfquery name="qUpdateSubject" datasource="#Variables.fw.Config.DSN#">
            INSERT INTO Data
            (Subject_Code, Subject_Name, Student_Name, Semester, RegistrationDate)
            VALUES ('a',
                    'z',


                   '#listsubject#',


                    '#Variables.fw.User.Sem#',
                    '#DateFormat(Now())#')
        </cfquery>

my objective is to insert the data from 2 tables... '#Variables.fw.User.Sem#' works fine but how do we called the another variable #listsubject#' ???

plz help, thanks


    This topic has been closed for replies.

    1 reply

    Nazi370Author
    Participant
    October 5, 2009

    really easy actually but i have no idea what happen to my machine ...i already tried that but not working

    just add #form.listsubject# ..

    thanks anyway

    -Naz