Beefy Boxes and Bandwidth Generously Provided by pair Networks
Just another Perl shrine
 
PerlMonks  

Re: Answer: What are placeholders in DBI, and why would I want to use them?

by EvdB (Deacon)
on Nov 13, 2003 at 09:21 UTC ( [id://306745]=note: print w/replies, xml ) Need Help??


in reply to Re: What are placeholders in DBI, and why would I want to use them?
in thread What are placeholders in DBI, and why would I want to use them?

You mean that DBI queries should be written:
my $query = $dbh->prepare ( "select id, name from user where name = ?" ); $query->execute( $name_from_params );
Instead of:
my $query = $dbh->prepare ( "select id, name from user " . "where name = '$name_from_params'" ); $query->execute();
Couldn't agree more.

--tidiness is the memory loss of environmental mnemonics

Log In?
Username:
Password:

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

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

    No recent polls found