in reply to •Re: called with 19 bind variables when 20 are needed, error
in thread called with 19 bind variables when 20 are needed, error

$sth->execute(map scalar param($_), qw(cat itemid price des longdes size o1n o1o o2n o2o o3n o3o c1n c1v c2n c2v c3n c3v),$small,$large) or die $dbh->errstr; Why doesnt that work
  • Comment on Re: •Re: called with 19 bind variables when 20 are needed, error
  • Download Code

Replies are listed 'Best First'.
•Re: Re: •Re: called with 19 bind variables when 20 are needed, error
by merlyn (Sage) on Jul 20, 2002 at 22:14 UTC
    Because $small and $large are being passed through the map. You need to add parens to the map arg list:
    $sth->execute(map(scalar param($_), qw(cat itemid price des longdes si +ze o1n o1o o2n o2o o3n o3o c1n c1v c2n c2v c3n c3v)),$small,$large) o +r die $dbh->errstr;

    -- Randal L. Schwartz, Perl hacker