Beefy Boxes and Bandwidth Generously Provided by pair Networks
go ahead... be a heretic
 
PerlMonks  

DBD::mysql and binding placeholders

by dragonchild (Archbishop)
on Sep 22, 2004 at 15:51 UTC ( [id://392941]=perlmeditation: print w/replies, xml ) Need Help??

Help for this page

Select Code to Download


  1. or download this
    create table foo (
        bar1 Int
       ,bar2 Int
    );
    
  2. or download this
    my $sth = $dbh->prepare_cached( "SELECT bar2 FROM foo WHERE bar1 = ?" 
    +);
    
    $sth->execute( 2 );
    
  3. or download this
    SELECT bar2 FROM foo WHERE bar1 = 2;
    
  4. or download this
    SELECT bar2 FROM foo WHERE bar1 = '2';
    
  5. or download this
    my $sth = $dbh->prepare_cached( "SELECT bar2 FROM foo WHERE bar1 = ?" 
    +);
    
    $sth->bind_param( 1, 2, SQL_INTEGER );
    
    $sth->execute();
    

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others taking refuge in the Monastery: (5)
As of 2024-04-24 01:37 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found