Skip to content

Instantly share code, notes, and snippets.

@korjavin
Created September 2, 2014 05:01
Show Gist options
  • Select an option

  • Save korjavin/bdce7414683f2609649e to your computer and use it in GitHub Desktop.

Select an option

Save korjavin/bdce7414683f2609649e to your computer and use it in GitHub Desktop.
#!/usr/bin/perl -w
$dbh =
DBI->connect( "DBI:mysql:dbname=mydb;", "root", "mypass",
{ RaiseError => 0, PrintError => 0, AutoCommit => 1 } );
$dbh->{'mysql_auto_reconnect'} = 1;
$stu1 = $dbh->prepare("update smt set value=?");
$sti1 = $dbh->prepare("insert int bbb values (?,?)");
$koeff=1;
$stu1->execute( $koeff );
for($i=1;$i<100;$i++){
$sti1->execute( $i,$i+1 );
}
$stu1->finish;
$sti1->finish;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment