Game Results Team Stats Individual Stats Home Roster & Schedule Pictures Driving Directions
<% ' this code opens the database myDSN="DSN=renegades" set conntemp=server.createobject("adodb.connection") conntemp.open myDSN ' this code retrieves the data mySQL3="select count(gamenum) as gn from scores" set rsscorescount=conntemp.execute(mySQL3) ' this code detects if data is empty If rsscorescount.eof then response.write "No records matched
" response.write mySQL & "
So cannot make table..." connection.close set connection=nothing response.end end if g_n = rsscorescount("gn") game_num=request.querystring("gamenum") if game_num = "" then game_num = g_n end if ' this code retrieves the data mySQL="select * from scores where gamenum= " & game_num & "" set rsscores=conntemp.execute(mySQL) ' this code detects if data is empty If rsscores.eof then response.write "No records matched
" response.write mySQL & "
So cannot make table..." connection.close set connection=nothing response.end end if ' this code retrieves the data mySQL2="select * from box_scores where game_number= " & game_num & " order by batting_order" set rstemp=conntemp.execute(mySQL2) ' this code detects if data is empty If rstemp.eof then response.write "No records matched
" response.write mySQL & "
So cannot make table..." connection.close set connection=nothing response.end end if Dim inn(7) Dim oppinn(7) ' put fields into variables rh = rsscores("renhome") opp=rsscores("opponent") ren_score=rsscores("renscore") opp_score=rsscores("oppscore") inn(0)=rsscores("first") inn(1)=rsscores("second") inn(2)=rsscores("third") inn(3)=rsscores("fourth") inn(4)=rsscores("fifth") inn(5)=rsscores("sixth") inn(6)=rsscores("seventh") oppinn(0)=rsscores("oppfirst") oppinn(1)=rsscores("oppsecond") oppinn(2)=rsscores("oppthird") oppinn(3)=rsscores("oppfourth") oppinn(4)=rsscores("oppfifth") oppinn(5)=rsscores("oppsixth") oppinn(6)=rsscores("oppseventh") innflag = 0 oppinnflag = 0 For x = 0 to 6 if inn(x) <> "" AND innflag = 0 then totscore = totscore + inn(x) lastinn = x + 1 else innflag = 1 end if if oppinn(x) <> "" AND oppinnflag = 0 then opptotscore = opptotscore + oppinn(x) opplastinn = x + 1 else oppinnflag = 1 end if next ' write the fields to browser cellstart="
" response.write "" response.write "" for y = 1 to g_n response.write "" if y = 5 and g_n > 9 then response.write "" end if next response.write "" response.write "
Game " & y & " Boxscore
" response.write "
Game " & game_num & " Results

" response.write "" 'response.write "" response.write "
" & totscore & " Renegades
" & opp_score & " " & opp & "
" if lastinn > opplastinn then innvar = lastinn else if opplastinn = NULL then innvar = lastinn else innvar = opplastinn end if end if response.write "" for i = 1 to innvar if i = 1 then suff = "st" end if if i=2 then suff = "nd" end if if i=3 then suff = "rd" end if if i=4 or i=5 or i=6 or i=7 then suff = "th" end if response.write "" next response.write "" response.write "" if rh = "True" then response.write "" for i = 0 to opplastinn-1 response.write "" next response.write "" response.write "" response.write "" for i = 0 to lastinn-1 response.write "" next if lastinn <> opplastinn then response.write "" end if response.write "" else response.write "" for i = 0 to lastinn-1 response.write "" next response.write "" response.write "" response.write "" for i = 0 to opplastinn-1 response.write "" next if lastinn <> opplastinn then response.write "" end if response.write "" end if response.write "" response.write "
" & i & suff & "Final
" & opp & "" & oppinn(i) & "" & opptotscore & "
Renegades" & inn(i) & "x" & totscore & "Renegades" & inn(i) & "" & totscore & "
" & opp & "" & oppinn(i) & "x" & opptotscore & "
" response.write "
" response.write "
" %> <% ' Now lets grab all the records DO UNTIL rstemp.eof ' put fields into variables player_name=rstemp("player_name") gender=rstemp("gender") game_number=rstemp("game_number") batting_order=rstemp("batting_order") ab=rstemp("ab") h=rstemp("h") r=rstemp("r") rbi=rstemp("rbi") hr=rstemp("hr") triples=rstemp("triples") doubles=rstemp("doubles") totab = ab + totab toth = h + toth totr = r + totr totrbi = rbi + totrbi tothr = hr + tothr tottriples = triples + tottriples totdoubles = doubles + totdoubles if ab <> 0 then avg=(h/ab) ' write the fields to browser cellstart="" response.write "" response.write cellstart & formatnumber(avg,3,0) & "" response.write cellstart & ab & "" response.write cellstart & h & "" response.write cellstart & r & "" response.write cellstart & rbi & "" response.write cellstart & hr & "" response.write cellstart & triples & "" response.write cellstart & doubles & "" response.write "" end if rstemp.movenext LOOP totavg=(toth/totab) response.write "" response.write "" response.write cellstart & formatnumber(totavg,3,0) & "" response.write cellstart & totab & "" response.write cellstart & toth & "" response.write cellstart & totr & "" response.write cellstart & totrbi & "" response.write cellstart & tothr & "" response.write cellstart & tottriples & "" response.write cellstart & totdoubles & "" response.write "" %>
Player Avg AB H R RBI HR 3B 2B
" response.write "
" & player_name & "
Totals
<% ' Now close and dispose of resources rsscores.close set rsscores=nothing rsscorescount.close set rsscorescount=nothing rstemp.close set rstemp=nothing conntemp.close set conntemp=nothing %>