Beefy Boxes and Bandwidth Generously Provided by pair Networks
Syntactic Confectionery Delight
 
PerlMonks  

Re: Mysql module

by Tomte (Priest)
on Mar 12, 2003 at 12:12 UTC ( [id://242326]=note: print w/replies, xml ) Need Help??


in reply to Mysql module

Funny no-one mentioned it so far: You should consider to develop the habit to always use prepared statements, passing in such things as parameters:

[...] my $queryStatementHandler = $dbh->prepare("SELECT field1,field2 FROM m +y_table WHERE LEFT(field3, ?) = ?"); $query->bind_param(1, $value_1); $query->bind_param(2, $var); $query->execute(); [...]

Not only is this (and the shorter forms DBI allows for) usually considered good style, but usually the safest form to talk to a DB.

regards,
tomte


Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others rifling through the Monastery: (6)
As of 2024-04-19 04:02 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found