Help for this page

Select Code to Download


  1. or download this
        my $sth = $dbh->prepare("
            INSERT INTO foo (first_col,second_col) VALUES (?,?)
        ");
        $sth->execute( $string, $number );
    
  2. or download this
        my $DEBUG = 1; # comment out when not debugging
        my $sql = "INSERT INTO foo (first_col,second_col) VALUES (?,?)";
    ...
        print "$sql\n[@params]\n" if $DEBUG;
        my $sth = $dbh->prepare( $sql );
        $sth->execute( @params );