<% option explicit %> <%=maintitle%> <% dim mrs, sqlcode, ID, mrs2, sqlcode2, edit, sqlcodeb, mrsb, selCatName, selCatID, rDate Dim mName, mReview, mAdvice, editRating, editYear, editCategory, editForm, deleteURL, editName dim actSQL, actRS 'look for and set querystring variables. ID = request.Querystring("ID") edit = request.querystring("edit") '***review query*** if edit = 1 then Dim CommentCount, rsComment, SQLcomment, ccount, counttotal set rsComment = server.createobject("adodb.recordset") SQLcomment = "select count(ID) as ccount from comments where movieID = " & ID & ";" rsComment.open SQLcomment, mconn counttotal = rsComment("ccount") ccount = "

total comments: " & counttotal & "

" rsComment.close end if '***review query*** set mrs = server.createobject("adodb.recordset") sqlcode = "select catID, catName from category" mrs.open sqlcode, mconn '***Cast Query*** set actRS = server.createobject("adodb.recordset") actSQL = "select cID, LastName, FirstName from act order by lastname" actRS.open actSQL, mconn, 1, 3 if actRS.recordcount < 1 then response.write ("

No " & talent_title & " found, please add one first.

") actRS.close set actRS = Nothing closeConn() %> <% response.end end if if request.querystring("message") = 1 then Response.Write("

Movie Review Added/Updated

") end if 'edit = request.querystring("edit") if edit = 1 then 'ID = request.Querystring("ID") set mrs2 = server.createobject("adodb.recordset") sqlcode2 = "select * from movies where movies.ID = " & ID mrs2.open sqlcode2, mconn dim act1, act2, act3, act4, mcatID act1 = mrs2("act1") act2 = mrs2("act2") act3 = mrs2("act3") act4 = mrs2("act4") mcatID = mrs2("mcatID") '***open category table*** if mcatID <> 0 then set mrsb = server.createobject("adodb.recordset") sqlcodeb = "select catID, catName from category where catID = " & mcatID mrsb.open sqlcodeb, mconn selCatName = mrsb("catName") selCatID = mrsb("CatID") mrsb.close set mrsb = Nothing end if '***open cast table 1*** if act1 <> 0 then dim actRS1, actSQL1, act1cID, act1LastName, act1FirstName set actRS1 = server.createobject("adodb.recordset") actSQL1 = "select * from act where cID = " & act1 & " order by lastname, firstname;" actRS1.open actSQL1, mconn, 1, 3 if actrs1.recordcount > 0 then Act1cID = actRS1("cID") Act1FirstName = actRS1("FirstName") act1LastName = actRS1("LastName") end if actRS1.close set actRS1 = Nothing end if '***open cast table 2*** if act2 <> 0 then dim actRS2, actSQL2, act2cID, act2LastName, act2FirstName set actRS2 = server.createobject("adodb.recordset") actSQL2 = "select * from act where cID = " & act2 & " order by lastname, firstname;" actRS2.open actSQL2, mconn, 1, 3 if actrs2.recordcount > 0 then Act2cID = actRS2("cID") Act2FirstName = actRS2("FirstName") act2LastName = actRS2("LastName") end if actRS2.close set actRS2 = Nothing end if '***open cast table 3*** if act3 <> 0 then dim actRS3, actSQL3, act3cID, act3LastName, act3FirstName set actRS3 = server.createobject("adodb.recordset") actSQL3 = "select * from act where cID = " & act3 & " order by lastname, firstname;" actRS3.open actSQL3, mconn, 1, 3 if actrs3.recordcount > 0 then Act3cID = actRS3("cID") Act3FirstName = actRS3("FirstName") act3LastName = actRS3("LastName") end if actRS3.close set actRS3 = Nothing end if '***open cast table 4*** if act4 <> 0 then dim actRS4, actSQL4, act4cID, act4LastName, act4FirstName set actRS4 = server.createobject("adodb.recordset") actSQL4 = "select * from act where cID = " & act4 & " order by lastname, firstname;" actRS4.open actSQL4, mconn, 1, 3 if actrs1.recordcount > 0 then Act4LastName = actRS4("cID") Act4FirstName = actRS4("FirstName") act4LastName = actRS4("LastName") end if actRS4.close set actRS4 = Nothing end if '************************************ rDate = mrs2("datadate") mName = mrs2("mName") mAdvice = mrs2("mAdvice") mReview = mrs2("mReview") editRating = ("") editYear = mrs2("mYear") editYear = ("") editCategory = ("") editForm = "" editName = "

" & mName & "

" deleteURL = "

delete this review

" mrs2.close set mrs2 = nothing else rDate = Date editYear = ("") editRating = ("") end if %> <%=ccount%> <%=editName%>
<%=editForm%>
rating Year
category
review date
title *
advice
review
<%=talent_title%>


 
<%=deleteURL%> <% actRS.close set actRS = nothing closeConn() %>