2 Replies Latest reply on Sep 2, 2007 11:55 PM by Dinghus

    combining variables to create 1 variable


      I'm trying to set an update page where users can add data to existing database entries.

      I have a query to get tour dates, which are listed on the page. Any user can add any missing information from the tour date information.

      I have named all the possible missing data fields on the form as "example_name#ID#" so that the action page has the ID number relevant to the particular entry that the user wants to add to.

      On the action page I have outputted the query to get the tour ID and looped around a <cfif isdefined("form.example_name#ID#")> in order for the data to recognise which entry to update. I have then <cfset example_name = "##"&"form.example_name"&"#ID#"&"##> to give the variable example_name a value of #form.example_name14# (or whatever number that particular entries ID is.

      I then query the insert to the table using VALUES ('example_name'). It inserts the record as "#form.example_name14#". Is there any way i can get the variable processed so that it infact outputs the actual data entered by the user?

      Many thanks!