Beefy Boxes and Bandwidth Generously Provided by pair Networks
Do you know where your variables are?
 
PerlMonks  

Where the advice to use DBI bind parameters can go wrong (long)

by dws (Chancellor)
on Jun 14, 2002 at 19:46 UTC ( #174709=perlmeditation: print w/ replies, xml ) Need Help??

Help for this page

Select Code to Download


  1. or download this
      $sth->prepare("SELECT * FROM companies WHERE name = '$name'");
  2. or download this
      $sth->prepare("SELECT * FROM companies WHERE name = ?");
  3. or download this
      $sth->prepare("SELECT name, url FROM table WHERE name LIKE '$name%');
  4. or download this
      $sth->prepare("SELECT name, url FROM table WHERE name LIKE ?");
      $sth->execute($name . '%');
    

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: perlmeditation [id://174709]
Approved by footpad
Front-paged by htoug
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others browsing the Monastery: (11)
As of 2014-10-01 19:12 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    What is your favourite meta-syntactic variable name?














    Results (34 votes), past polls