I have a list like this thing1,thing2,thing3. And I want to insert them into a look-up table with the same foreign key. So ideally it would look like this:
I would add a counter and increment it inside the loop. Also you need to use listLen() rather than len on your list to get the number of items.
listLen()
len
INSERT INTO lkp_things (foreign_key, thing) VALUES ( , ),
You should use cfqueryparam on all your values. I've guessed on what type the column is.
cfqueryparam