I have some ColdFusion output:
<cfoutput query="myList">#Email#</cfoutput>
If my list happens to have several results, this output loops and prints out all the emails. However, if there are no results, I would like to write a statement to output a message...
How does this work? It seems like #Email#
is a variable, but it can also be an array...how do I count the number of results when using like this?
update: I have also tried using a stored procedure to do a COUNT, which gives me the amount...but I'm not sure how to use the results of the stored procedure in a coldfusion <cfif>
statement...
<cfif myList.RecordCount>
<cfoutput query="myList">#Email#</cfoutput>
<cfelse>
No results
</cfif>
is what you are looking for, and is the strategy most commonly employed by ColdFusion developers.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With