#!/usr/local/bin/perl use DBI; use CGI qw(:standard); print header; print start_html; $ENV {'ORACLE_HOME'}= '/oracle/u01'; $host="??"; $sid="???"; $username="?????"; $password="??????"; $sport = 'basket ball'; $dbh = DBI->connect( "dbi:Oracle:host=$host;sid=$sid",$username, $password)|| die "Can't connect to Oracle"; $sth = $dbh->prepare("SELECT year from trees WHERE sport = \'$sport\' AND year = \'$year\'")|| die "couldn't prepareSQL statement"; $sth->execute || die "can't execute sql statement"; my @row; while (@row = $sth->fetchrow_array()) { $year = $row[0]; } $sth2 = $dbh->prepare("SELECT teamno from compsize WHERE sport = \'$sport\' AND year = \'$year\'")|| die "couldn't prepareSQL statement"; $sth2->execute || die "can't execute sql statement"; my @row2; while (@row2 = $sth2->fetchrow_array()) { $compsize = $row2[0]; } if ($compsize == 7){ my $cgi = new CGI; my %teams; $teams{"team$_"} = $cgi->param("team$_") for 1..($compsize * 2) - 1; my %scores; $scores{"score$_"} = $cgi->param("score$_") for 1..($compsize * 2) - 1; } print "
| List of info | \n"; print "
|---|
| $team | \n"; print "
| $team | \n"; print "
| $score | \n"; print "
| all done | \n"; print "