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();