assuming the database connects as it should do (it does) will the followind sql statement work?
$sport = 'basket ball' $sth5 = $dbh->prepare("SELECT round, teamname, score from trees where +sport =\'$sport\' AND year = \'$year\', ORDER BY round DESC") || die +"Can't prepare SQL get data statement"; $sth5->execute || die "can't execute sql statement";
$rowcount = 0; while (@row = $sth5->fetchrow_array()) { $round = $row[0]; $teamname = $row[1]; $Score = $row[2]; push @ list_of_teamdata, qw("$round $teamname $score"); $rowcount++; }
i want to produce the following data structure after this while loop executes
round 1 team 1 score 1 round 2 team 2 score 2 round 3 team 3 score 3 round 4 team 4 score 4
so that i can reference these variables from the lists of lists created by the above. and output them into the html as follows.
$compsize = $#list1+1; if ($compSize == 7){ print "<tr>\n"; print "<td width=\"9%\">&nbsp;</td>\n"; print "<td width=\"9%\">&nbsp;</td>\n"; print "<td width=\"9%\">image3</td>\n"; print "<td width=\"9%\">&nbsp;</td>\n"; print "<td width=\"9%\">&nbsp;</td>\n"; print "<td width=\"9%\">&nbsp;</td>\n"; print "<td width=\"9%\">&nbsp;</td>\n"; print "<td width=\"9%\">&nbsp;</td>\n"; print "<td width=\"9%\">&nbsp;</td>\n"; print "<td width=\"9%\">&nbsp;</td>\n"; print "<td width=\"10%\">&nbsp;</td>\n"; print "</tr>\n"; print "<tr>\n"; print "<td width=\"9%\"><b><P align=center><SELECT name=Team6 size=1 +>\n"; print "<OPTION selected value=101>$list_of_teamdata[5][1]</OPTION>\n +"; print "<OPTION value=102>Business School</OPTION>\n"; print "<OPTION value=103>Admin/Estates</OPTION>\n"; print "<OPTION value=104>CEAC </OPTION>\n"; print "<OPTION value=105>Civ Eng</OPTION>\n"; print "<OPTION value=106>Combined Honours</OPTION>\n"; print "<OPTION value=107>CSAM</OPTION>\n"; print "<OPTION value=108>EEAP</OPTION>\n"; print "<OPTION value=109>MechEng</OPTION>\n"; print "<OPTION value=110>ModLang</OPTION>\n"; print "<OPTION value=111>Vision Sciences</OPTION>\n"; print "<OPTION value=112>Pharmacy</OPTION>\n"; print "&nbsp;</SELECT>\n"; print "</P>\n"; print "</td>\n"; print "</b>\n"; print "<td width=\"9%\"><b><P align=center><SELECT name=score6 size= +1>\n"; print "<OPTION selected value=101>$list_of_teamdata[5][2]</OPTION>\n +"; print "<OPTION value=103>0</OPTION>\n"; print "<OPTION value=103>1</OPTION>\n"; print "<OPTION value=104>2</OPTION>\n"; print "<OPTION value=105>3</OPTION>\n"; print "<OPTION value=106>4</OPTION>\n"; print "<OPTION value=107>5</OPTION>\n"; print "<OPTION value=108>6</OPTION>\n"; print "<OPTION value=109>7</OPTION>\n"; print "<OPTION value=110>8</OPTION>\n"; print "<OPTION value=111>9</OPTION>\n"; print "<OPTION value=112>10</OPTION>\n"; print "<OPTION value=113>11</OPTION>\n"; print "<OPTION value=114>12</OPTION>\n"; print "&nbsp;</SELECT>\n"; print "</P>\n"; print "</td>\n"; print "</b>\n"; print "<td width=\"9%\">image3</td>\n"; print "<td width=\"9%\">&nbsp;</td>\n"; print "<td width=\"9%\">&nbsp;</td>\n"; print "<td width=\"9%\">&nbsp;</td>\n"; print "<td width=\"9%\">&nbsp;</td>\n"; print "<td width=\"9%\">&nbsp;</td>\n"; print "<td width=\"9%\">&nbsp;</td>\n"; print "<td width=\"9%\">&nbsp;</td>\n"; print "<td width=\"10%\">&nbsp;</td>\n"; print "</tr>\n"; print "<tr>\n"; print "<td width=\"9%\">&nbsp;</td>\n"; print "<td width=\"9%\">&nbsp;</td>\n"; print "<td width=\"9%\">&nbsp;</td>\n"; print "<td width=\"9%\">&nbsp;</td>\n"; print "<td width=\"9%\">&nbsp;</td>\n"; print "<td width=\"9%\">&nbsp;</td>\n"; print "<td width=\"9%\">&nbsp;</td>\n"; print "<td width=\"9%\">&nbsp;</td>\n"; print "<td width=\"9%\">&nbsp;</td>\n"; print "<td width=\"9%\">&nbsp;</td>\n"; print "<td width=\"10%\">&nbsp;</td>\n"; print "</tr>\n"; print "<tr>\n"; print "<td width=\"9%\">&nbsp;</td>\n"; print "<td width=\"9%\">&nbsp;</td>\n"; print "<td width=\"9%\">&nbsp;</td>\n"; print "<td width=\"9%\">&nbsp;</td>\n"; print "<td width=\"9%\">&nbsp;</td>\n"; print "<td width=\"9%\">&nbsp;</td>\n"; print "<td width=\"9%\">&nbsp;</td>\n"; print "<td width=\"9%\">&nbsp;</td>\n"; print "<td width=\"9%\">&nbsp;</td>\n"; print "<td width=\"9%\">&nbsp;</td>\n"; print "<td width=\"10%\">&nbsp;</td>\n"; print "</tr>\n"; print "</table>\n"; print "</body>\n"; print "</html>\n"; }

In reply to dbi issues by Anonymous Monk

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.