Hi all,

The voting system rears it's ugly head again and I have a slight problem.

Let's say no one votes, I want to display a message that reads "No one has 
voted in this poll" or something to that extent, now, I have this all in 1 
cfoutput tag, and under that I've basically dumped all my "stuff".

The problem is that, I get the same message (no one has voted in this poll) 
appearing for the number of vote choices. So if you can choose 3 options to 
vote for, you'll get the message 3 times.

Is there a way to only print that message once within that output query? 
I'll include the query and the code for the hell of it.

<CFQUERY DATASOURCE = "Stranger" NAME = "Totals">

SELECT Q.Question, SUM(A.Votes) AS TotalVotes
FROM Question Q INNER JOIN Answer A ON Q.QuestionID = A.QuestionID
WHERE Q.QuestionID = #QuestionID#
GROUP BY Q.Question
</CFQUERY>

<CFOUTPUT QUERY = "Results">
<!--- Set the percent of total votes for each answer. --->
<tr>
<td colspan="3"><CFIF Totals.TotalVotes EQ 0>No Votes Have Been 
Cast.<CFELSE><CFSET Percent = Round((Votes / Totals.TotalVotes) * 
100)><B><i>#Answer#:</i></B> #Percent#%</td>
</tr>
<!--- Dispaly the percentage of votes in a graph format. The width of the 
bar image is equal to the percentage.--->
<tr>
<td colspan="3">
<IMG ALIGN = "top" SRC = "vote_undecided.gif" WIDTH = "#Percent#" HEIGHT = 
"5">
</cfif>
</CFOUTPUT>
</p>
</td>
</tr>

Mark Smeets/stranger0/ICQ #1062196

"Mr. West, not every situation requires your patented approach of shoot 
first, shoot later, shoot some more and then when everybody's dead try to 
ask a question or two" - Wild Wild West

Official Splitting Adam Homepage
http://www.splittingadam.com/

Over the Wall Productions and Web Designs
http://www.solarcourt.com/

_________________________________________________________________________
Get Your Private, Free E-mail from MSN Hotmail at http://www.hotmail.com.


Archives: http://www.mail-archive.com/[email protected]/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists

Reply via email to