http://qs321.pair.com?node_id=138138


in reply to Re: Good Programming is Better
in thread Good Programming is Better

My rationale for using prepare is so I can use placeholders, so I can have arbitrary numbers of columns, and don't have to think about whether I need quotes. But if one can use placeholders with do, that'd be even sweeter.

§ George Sherston

Replies are listed 'Best First'.
Re: Re: (FoxUni) Re: Good Programming is Better
by gav^ (Curate) on Jan 12, 2002 at 01:12 UTC
    You can use placeholders with do. Just make sure you use undef as the first param.
    $dbh->do('insert into blah (?, ?, ?)', undef, $x, $y, $z);