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

Re: called with 19 bind variables when 20 are needed

by gav^ (Curate)
on Jul 20, 2002 at 22:42 UTC ( #183693=note: print w/ replies, xml ) Need Help??


in reply to called with 19 bind variables when 20 are needed, error

Personally I find something like this easier to read and definatly less error prone, the field names are only in one place:

my @fields = qw/cat itemid price des longdes size o1n o1o o2n o2o o3n o3o c1n c1v c2n c2v c3n c3v small large/; my $sql = sprintf 'INSERT INTO items (%s) VALUES (%s)', join(',', @fields), join(',', (?) x @fields); $dbh->do($sql, undef, map scalar param($_), @fields);

gav^


Comment on Re: called with 19 bind variables when 20 are needed
Download Code

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others exploiting the Monastery: (9)
As of 2015-07-06 06:52 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 (70 votes), past polls