Beefy Boxes and Bandwidth Generously Provided by pair Networks
Don't ask to ask, just ask
 
PerlMonks  

Re: Writing to DB with quotes

by davidrw (Prior)
on Jun 29, 2006 at 00:01 UTC ( [id://558188]=note: print w/replies, xml ) Need Help??


in reply to Writing to DB with quotes

use placeholders:
$sth_2 = $dbh->prepare("UPDATE options SET trend = ? WHERE ticker = ?" +); $sth_2->execute( $trend, $ticker );
this also lets you reuse the prepared statement:
$sth_2->execute( $other_trend, $other_ticker );

Replies are listed 'Best First'.
Re^2: Writing to DB with quotes
by lhoward (Vicar) on Jun 29, 2006 at 12:12 UTC
    I would like to re-iterate, use placeholders. It will get you better performance & protection from SQL injection problems.

    Les

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others rifling through the Monastery: (5)
As of 2024-03-29 13:56 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found