Help for this page

Select Code to Download


  1. or download this
      $sth = $dbh->prepare("SELECT foo, bar FROM table WHERE baz=?");
      $sth->execute( $baz );
      while ( @row = $sth->fetchrow_array ) {
        print "@row\n";
      }
    
  2. or download this
      $sth = $dbh->prepare("INSERT INTO table(foo,bar,baz) VALUES (?,?,?)"
    +);
      while(<CSV>) {
    ...
        my ($foo,$bar,$baz) = split /,/;
            $sth->execute( $foo, $bar, $baz );
      }