[nzlug] quoting perl strings

Glenn Enright glenn.enright at gmail.com
Mon Oct 1 11:17:26 NZST 2007


On 01/10/2007, Simon Green <simon at simongreen.net> wrote:
> use DBI (and the DBD for your database), and you won't need to worry
> about quoting at all. A way over simplified example is
> $dbh->do("INSERT INTO example (col1, col2) VALUES (?, ?)", undef,
> $string1, $string2);

So this would work for te cas where $string1 has double or single quotes?

-- 
See my blog at
http://snap-happy3216.blogspot.com



More information about the NZLUG mailing list