I'm trying to display the "top 5" images downloaded from our site. I've
attached the code I'm currently working with.
All seems fine except I can't "order by" results from the count value "numImg"
Any ideas?
Cheers
Trevor
<CFQUERY NAME="GetImg" DATASOURCE="uka_comments">
SELECT strImage, COUNT(*) AS numImg FROM multimedia_feedback
GROUP BY strImage
ORDER BY strImage
</CFQUERY>
<cfoutput query="GetImg"><IMG SRC="multimedia/mm_images/#strImage#"><br
/></cfoutput>
You can always do QoQ over your GetImg results...
<CFQUERY NAME="GetImg" DATASOURCE="uka_comments">
select strImage, count(strImage) as entries from multimedia_feedback group by
strImage order by count(strImage) DESC
</CFQUERY>
Works a treat.
Cheers
Trevor