Variable within a variable - select syntax

Variable within a variable - select syntax

Post by Justi » Mon, 12 Jul 1999 04:00:00



      I am trying to loop through a series of SELECT statements that perform
Cold Fusion Queries based on conditions passed through a form on a previous
page.

      instead of:

      SELECT * FROM Table WHERE ID LIKE '#form.response1#'
      SELECT * FROM Table WHERE ID LIKE '#form.response2#'
      SELECT * FROM Table WHERE ID LIKE '#form.response3#'
      etc...
      I would like a variable, say "name", to cycle through the various form
elements... so I have (in my loop):

      SELECT * FROM Table WHERE ID LIKE '#form.#name##'

      "form" is my form and "name" is a variable - but this syntax obviously
doesn't work... is there any syntax available that allows a variable within
a form expression?