stonecolddevin has asked for the wisdom of the Perl Monks concerning the following question:
Values is my array, and it needs to contain data which will be join'd by commas (,). I can't figure out how to use an array as a parameter though.$db->insert('table_name', @values);
I'm probably over thinking this, but any help is appreciated.sub insert { my $self = shift; my @values = @the_array_parameter; my $query = "INSERT INTO " . $q[0] . " VALUES( " . join (',', @values); $dbh->do($query); }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Need an array as a function parameter
by blue_cowdawg (Monsignor) on Mar 27, 2004 at 21:26 UTC | |
by CountZero (Bishop) on Mar 27, 2004 at 21:34 UTC | |
by optimist (Beadle) on Mar 27, 2004 at 23:15 UTC | |
by stonecolddevin (Parson) on Mar 27, 2004 at 21:30 UTC | |
by blue_cowdawg (Monsignor) on Mar 27, 2004 at 21:39 UTC | |
|
Re: Need an array as a function parameter
by cchampion (Curate) on Mar 27, 2004 at 21:42 UTC |