Beefy Boxes and Bandwidth Generously Provided by pair Networks
P is for Practical
 
PerlMonks  

Re^2: Mysql queries with ' and "

by runrig (Abbot)
on Mar 12, 2014 at 20:23 UTC ( [id://1078092]=note: print w/replies, xml ) Need Help??


in reply to Re: Mysql queries with ' and "
in thread Mysql queries with ' and "

$insert_query =~ s/'/\\'/g;
No, the right way would be to use the $dbh->quote() method, or even better, to use placeholders as suggested below.

Replies are listed 'Best First'.
Re^3: Mysql queries with ' and "
by fattahsafa (Sexton) on Mar 12, 2014 at 20:36 UTC
    Thank you ! Placeholder works well

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://1078092]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others cooling their heels in the Monastery: (8)
As of 2024-04-23 10:31 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found