Jump to content

Recommended Posts

Posted

Afternoon again all

 

Right, i am creating a section of our web site which creates surveys and outputs the results with the bolean and multi choice ones outputting as a pretty bar graph, i have the code outputting and creating a graph for one question at a time (here) but i can not get the code to create all results on one page

 

I have two tables in the db (that deal with bolean) one called questions the other answers (simple see) the answers one stored its own id the question it is the answer too what type of answer it is (boolean or not) the answer and what quiz/survey it is from.

this code will out put

 

the question how many yes an how many no.

 

please help!!!!!!

<%
dim Ycounter
Ycounter = 0
dim Ncounter
Ncounter = 0
%>  
 
<%Do While Not rsas.EOF%>
				<%if rsas("qtype") = "boolean" then%>
<%

if rsas("qid") = questionid then

if rsas("answer") = "y" then
Ycounter = Ycounter + 1  
else
Ncounter = Ncounter + 1
end if

dim qref
qref = (rsas("qid"))

end if

%>

<%end if%>
                   
                
                   
<%rsas.movenext 
Loop
rsas.movefirst%>



<%Do While Not rsqs.EOF%>

<%
if rsqs("ID") = int(qref) then
myq = rsqs("question")
end if
%>

<%rsqs.movenext 
Loop
rsqs.movefirst%>

 
<%=myq%>
 
   
Yes = <%=Ycounter%>
   
No = <%=Ncounter%>
     <%dim tot
tot = Ycounter + Ncounter%>
   
Total = <%=tot%>
 

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now



×
×
  • Create New...