the form works the submit works there are no syntax errors comming up from the debugger.print "<td width=\"9%\"><b><P align=center><SELECT name=team1 size=1>\ +n"; print "<OPTION selected>$list_of_teamdata[0][1]</OPTION>\n"; print "<OPTION>Business School</OPTION>\n"; print "<OPTION>Admin/Estates</OPTION>\n"; print "<OPTION>CEAC </OPTION>\n"; print "<OPTION>Civ Eng</OPTION>\n"; print "<OPTION>Combined Honours</OPTION>\n"; print "<OPTION>CSAM</OPTION>\n"; print "<OPTION>EEAP</OPTION>\n"; print "<OPTION>MechEng</OPTION>\n"; print "<OPTION>ModLang</OPTION>\n"; print "<OPTION>Vision Sciences</OPTION>\n"; print "<OPTION>Pharmacy</OPTION>\n"; print " </SELECT>\n"; print "</P>\n"; print "</td>\n"; print "</b>\n"; print "<td width=\"9%\"><b><P align=center><SELECT name=score1 size=1> +\n"; print "<OPTION selected>$list_of_teamdata[0][2]</OPTION>\n"; print "<OPTION>0</OPTION>\n"; print "<OPTION>1</OPTION>\n"; print "<OPTION>2</OPTION>\n"; print "<OPTION>3</OPTION>\n"; print "<OPTION>4</OPTION>\n"; print "<OPTION>5</OPTION>\n"; print "<OPTION>6</OPTION>\n"; print "<OPTION>7</OPTION>\n"; print "<OPTION>8</OPTION>\n"; print "<OPTION>9</OPTION>\n"; print "<OPTION>10</OPTION>\n"; print "<OPTION>11</OPTION>\n"; print "<OPTION>12</OPTION>\n"; print " </SELECT>\n"; print "</P>\n"; print "</td>\n"; print "</b>\n";
i know the oracle statements are just about right. can u help???#!/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, $pass +word)|| 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 = \'$s +port\' 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 "<table border=1> \n"; print "<tr> \n"; print "<th> List of info </th> \n"; print "<tr> \n"; for $team(keys %teams){ print "<tr> \n"; print "<td>$team </td> \n"; print "</tr> \n"; } for $team(keys %teams){ print "<tr> \n"; print "<td>$team</td> \n"; print "</tr> \n"; } for $score(keys %scores){ print "<tr> \n"; print "<td>$score </td> \n"; print "</tr> \n"; } my $teampos; for $i (1..($compsize * 2) - 1 ){ for $team(keys %teams){ $teampos = $I; my $row1 = $dbh->do("UPDATE trees SET department = /'$team/', WHERE ro +und = /'$teampos/'") || die "Can't execute SQL update statement 1"; my $row2 = $dbh->do("UPDATE results SET score = /'$score/', WHERE year + = /'$year/' AND sport = /'$sport/' AND department = /'$team/'") || d +ie "Can't execute SQL update statement 2"; } for $score (keys %scores){ $teampos = $I; my $row3 = $dbh->do("UPDATE trees SET score = /'$score/', WHERE round += /'$teampos/'") || die "Can't execute SQL update statement 3"; } } print "<tr> \n"; print "<td>all done </td> \n"; print "</tr> \n"; print "</table>"; print "</body>"; print "</html>";
In reply to script problems1 by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |