Question : Perl MySQL DBI Insert with Quotes

I have a dbh->do(qq"INSERT .... |); statement, but it will error if a $string has quotes in it - is there any easy way around this?

I'm aware of dbh-quote but then all the output is encased in quotes?

Answer : Perl MySQL DBI Insert with Quotes

replace all ' with \' in the text you want to insert/use in your SQL. Better use bindings for variable in this case.
Random Solutions  
 
programming4us programming4us