Dieter: I've did this and this is what the list looks like ['1', '2', '3'], when i submit it doesn't do 1 insert for each element it just does one. this is how it comes from my from: <input type=checkbox name=options:list value=1>1 <input type=checkbox name=options:list value=2>2 <input type=checkbox name=options:list value=2>2 then my sql statement: <dtml-in options> insert into UserRoles values (<dtml-sqlvar options type=string>) <dtml-unless sequence-end><dtml-var delimiter></dtml-unless> </dtml-in> Can you make any other suggestions.... sorry for being pain just need some help! Todd At 07:21 PM 2/26/2002 +0100, you wrote:
Todd Loomis writes:
Could you explain a little more I still seem to be trying to input everything all on one record. I need to break out in an array then each needs to be added to the database as a separate record. Maybe I missed something. I can only be more specific when I know your data model.
The explanation is already almost as specific as it can be:
.... Thus, you use something like:
<dtml-in options> insert into ... <dtml-unless sequence-end><dtml-var sql_delimiter></dtml-unless> </dtml-in> Provided "options" contains a sequence, then you will get one insert for each sequence element.
The missing parts are your data model...
Dieter
Todd Loomis writes:
I've did this and this is what the list looks like ['1', '2', '3'], when i submit it doesn't do 1 insert for each element it just does one. ... <dtml-in options> insert into UserRoles values (<dtml-sqlvar options type=string>) <dtml-unless sequence-end><dtml-var delimiter></dtml-unless> </dtml-in>
Can you make any other suggestions.... sorry for being pain just need some help! Replace
<dtml-sqlvar options type=string> with <dtml-sqlvar sequence-item type=string> and <dtml-var delimiter> with <dtml-var sql_delimiter> Usually, I would say, you need to read something about the use of "dtml-in" and to be more careful when instantiating examples. Dieter
participants (2)
-
Dieter Maurer -
Todd Loomis