Skip to main content
Participant
September 25, 2008
Answered

Looping Dynamic form content for SQL Insert

  • September 25, 2008
  • 1 reply
  • 286 views
I have a form that is created when a user selects the number of rows that they need ultimately deciding on how many records they will be inserting into an SQL database. After they fill out there information in the form and submit it I have a page that has the SQL query. I am attempting to loop the query the same number of rows that there are in the table. However I cannot get the query to run because of duplicate variables. For example in a simple form submission if I had a form text field called "Name" it would insert into the database as '#form.name#'. If the user selected 10 rows I would need to insert each row as '#form.name1#', '#form.name2#', etc. If my variable for the number of rows is "i" then my entire variable for the loop would be '#form.name#i##' which does not work. Hope it's not too confusing and any and all help would be appreciated.
    This topic has been closed for replies.
    Correct answer Bob_Noxious
    That did it! Thank you so much!

    1 reply

    Inspiring
    September 25, 2008
    #form["contsant_part" & variable_part]#
    Bob_NoxiousAuthorCorrect answer
    Participant
    September 25, 2008
    That did it! Thank you so much!