List values to rows

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • ndeeley
    New Member
    • Mar 2007
    • 139

    List values to rows

    Hi,

    I have a table in a db that stores a users skillset.
    There are 3 columns: the users name, the skillset (eg Access) and their proficiency ('Beginner' etc).

    Currently I'm storing these as a separate line, so with 10 skillsets each user will have ten rows. But that means i have to create 10 select boxes for them to choose their proficiency. And I`m naturally lazy.

    Instead I've created a table showing the skillsets as a 10 rows in one column, and have looped over the output to auto generate 10 select boxes. But now CF sees the output as one row, with the user name in a column, a comma separated list of skills, and a comma separated list of proficiencies in the last.

    How can I turn this list back into separate rows of data to enter into the database, so skill matches proficiency?

    Thanks
    Neil
  • acoder
    Recognized Expert MVP
    • Nov 2006
    • 16032

    #2
    You can loop over the skill-set list and use ListGetAt() to get the corresponding proficiency from its list, e.g. keep a counter which you increment.

    Comment

    • ndeeley
      New Member
      • Mar 2007
      • 139

      #3
      That's great, thanks acoder - worked a treat.

      Neil

      Comment

      Working...