Help for this page

Select Code to Download


  1. or download this
    open(INPUT, '<', 'Path/file_with_updates.sql') or die ("Error opening 
    +file with updates: " . $!);
    while (<INPUT>) {
        $dbh->do($_) or die("Error executing query [$_]: " . $dbh->errstr)
    +;
    }
    close(INPUT);
    
  2. or download this
    my $sth = $dbh->prepare('UPDATE Games SET Away_Team_ID=(SELECT Team_ID
    + FROM Teams WHERE Name = ?) WHERE Date = ?') or die("Error preparing 
    +statement: " . $dbh->errstr);
    open(INPUT, '<', 'Path/file_with_data') or die ("Error opening file wi
    +th updates: " . $!);
    ...
        $sth->execute($teamname, $gamedate) or die("Error executing update
    +: " . $dbh->errstr);
    }
    close(INPUT);