Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 2597
  • Last Modified:

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?
0
logicjb
Asked:
logicjb
1 Solution
 
hernst42Commented:
replace all ' with \' in the text you want to insert/use in your SQL. Better use bindings for variable in this case.
0

Featured Post

Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now