[nzlug] quoting perl strings
Simon Green
simon at simongreen.net
Mon Oct 1 11:02:22 NZST 2007
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);
-- simon
On 01/10/2007, Glenn Enright <glenn.enright at gmail.com> wrote:
> Hi all, can anyone offer a suggestion as to how I may do this thing.
>
> More specifically, Im assigning a value to a quoted string for an SQL
> statement. But one of the values has a single quote mark in it, and
> possible other unusual characters as well. whats the best thing (TM)
> to do here? Run a regex on it?
More information about the NZLUG
mailing list