[Catalyst] Insert Multiple rows
Will Smith
willbelair at yahoo.com
Mon Dec 19 16:12:56 CET 2005
Hi Andy -
Thanks for your time and instruction - But that's not what I want to do. Could I explain one more time:
Normally on the template, I have 1 box - named Cdname, and this could be added to the table using the do_add sub created by the Scaffold Helper(using the From_Form/As_Form), when I hit enter, 1 new row will be created. Now I run into the case that I need to have on the TT 2 or more boxes of the same name Cdname, so that I could enter in every box the name of the CD and hit enter, then the do_add will insert into the table more than 1 row at a time. I guess this call: Insert multiple rows into the database.
How can I do this with Catalyst? Please give me some instruction or sample to follow.
Thank you.
Andy Grundman <andy at hybridized.org> wrote:
Will Smith wrote:
> Hi,
> Sorry to ask the question one more time.
>
> How could I insert multiple rows? On the template I have input boxes of
> the same name that allow user enter more than one value at a time, and
> need to insert those into the db.
> Anyone could give me some guide or sample? Deeply appreciated
> ps: The moderators please do not get mad.
I think you're really asking how to get multiple values for form
elements that have the same name:
my @values = $c->req->param('foo'); # array
my $values = $c->req->param('foo'); # array ref
my $values = $c->req->params->{foo}; # array ref
-Andy
_______________________________________________
Catalyst mailing list
Catalyst at lists.rawmode.org
http://lists.rawmode.org/mailman/listinfo/catalyst
__________________________________________________
Do You Yahoo!?
Tired of spam? Yahoo! Mail has the best spam protection around
http://mail.yahoo.com
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.rawmode.org/pipermail/catalyst/attachments/20051219/67dedf6d/attachment.htm
More information about the Catalyst
mailing list