Help for this page

Select Code to Download


  1. or download this
      $dbh = DBI->connect($dsn, $user, $password,
                          { RaiseError => 1, AutoCommit => 0 });
    
  2. or download this
      my $sth = $dbh->prepare(q{
        INSERT INTO sales (product_code, qty, price) VALUES (?, ?, ?)
    ...
          $sth->execute($product_code, $qty, $price) or die $dbh->errstr;
      }
      $dbh->commit or die $dbh->errstr;