Mailing List Archive

multiple records from a textarea
How would be the best way to use DBIx::Recordset to insert multiple records
of data like such:

I have a textarea that will contain a list of items, one per line, separated
by newlines...the other data on the page (category, etc...) will remain the
same, but I need to insert a record for every row of items...how should I do
this using DBIx::Recordset??

I've tried several methods, including split()ing the $fdat{'items'} field on
newlines and doing an Insert{\%fdat}in a foreach $item (@items) loop...this
just succeeds in putting NULL's and 0's in every field...once for every item
:-)

Any suggestions or help would be appreciated! :-)

Jon Brisbin
Re: multiple records from a textarea [ In reply to ]
how about...
[$ foreach $n ( split(/\r\n/, $fdat{items}) ) $]
do something with $n...
[$ endforeach $]

sherwin

brisbin@ipa.net writes:
>How would be the best way to use DBIx::Recordset to insert multiple
>records
>of data like such:
>
>I have a textarea that will contain a list of items, one per line,
>separated
>by newlines...the other data on the page (category, etc...) will remain
>the
>same, but I need to insert a record for every row of items...how should I
>do
>this using DBIx::Recordset??
>
>I've tried several methods, including split()ing the $fdat{'items'} field
>on
>newlines and doing an Insert{\%fdat}in a foreach $item (@items)
>loop...this
>just succeeds in putting NULL's and 0's in every field...once for every
>item
>:-)
>
>Any suggestions or help would be appreciated! :-)
>
>Jon Brisbin
Re: multiple records from a textarea [ In reply to ]
that did it! :-) i just needed the "\r"...what's that character??

Jon Brisbin

----- Original Message -----
From: Sherwin Daganato <win@email.com.ph>
To: <brisbin@ipa.net>; <embperl@perl.apache.org>
Sent: Monday, August 07, 2000 4:30 AM
Subject: Re: multiple records from a textarea


> how about...
> [$ foreach $n ( split(/\r\n/, $fdat{items}) ) $]
> do something with $n...
> [$ endforeach $]
>
> sherwin
>
> brisbin@ipa.net writes:
> >How would be the best way to use DBIx::Recordset to insert multiple
> >records
> >of data like such:
> >
> >I have a textarea that will contain a list of items, one per line,
> >separated
> >by newlines...the other data on the page (category, etc...) will remain
> >the
> >same, but I need to insert a record for every row of items...how should I
> >do
> >this using DBIx::Recordset??
> >
> >I've tried several methods, including split()ing the $fdat{'items'} field
> >on
> >newlines and doing an Insert{\%fdat}in a foreach $item (@items)
> >loop...this
> >just succeeds in putting NULL's and 0's in every field...once for every
> >item
> >:-)
> >
> >Any suggestions or help would be appreciated! :-)
> >
> >Jon Brisbin
>
>
Re: multiple records from a textarea [ In reply to ]
> that did it! :-) i just needed the "\r"...what's that character??
>

it's called "carridge return"

Gerald


-------------------------------------------------------------
Gerald Richter ecos electronic communication services gmbh
Internetconnect * Webserver/-design/-datenbanken * Consulting

Post: Tulpenstrasse 5 D-55276 Dienheim b. Mainz
E-Mail: richter@ecos.de Voice: +49 6133 925151
WWW: http://www.ecos.de Fax: +49 6133 925152
-------------------------------------------------------------