Improve company productivity with a Business Account.Sign Up

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 2607
  • 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
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

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