Beefy Boxes and Bandwidth Generously Provided by pair Networks
The stupid question is the question not asked
 
PerlMonks  

Re: DBI and Inserting an Array

by krujos (Curate)
on Mar 12, 2004 at 00:28 UTC ( #336039=note: print w/ replies, xml ) Need Help??


in reply to DBI and Inserting an Array

I was able to do it using the following.

my $sth = $dbh->prepare("INSERT INTO $table ($cols) VALUES (?,?,?)") or die "$dbh->errstr"; my @array=('one', 'two', 'thee'); $sth->execute(@array) or die "$dbh->errstr : $table";
You should be able to plug your code in pretty easily.


Comment on Re: DBI and Inserting an Array
Download Code
Replies are listed 'Best First'.
Re: Re: DBI and Inserting an Array
by carric (Beadle) on Mar 12, 2004 at 04:55 UTC
    Excellent. Thanks guys. That did the trick!! =)

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://336039]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others contemplating the Monastery: (15)
As of 2015-07-07 20:26 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The top three priorities of my open tasks are (in descending order of likelihood to be worked on) ...









    Results (93 votes), past polls