in reply to Writing to DB with quotes
The DBI module comes with a method to do just this type of quoting that you are looking for. For instance:
It also isn't necessary to put a ';' in the prepare statement. If you check out this chapter from the O'Reilly Perl DBI reference and search for 'quotes', it will discuss escaping them.$trend="<img src='images/down.jpg'>"; my $qtrend = $dbh->quote($trend); my $qticker = $dbh->quote($ticker); $sth_2 = $dbh->prepare("UPDATE options SET trend=$qtrend WHERE ticker += $qticker"); $sth_2->execute();
|
---|