<cfquery datasource="canadacrew" name="listimages"> SELECT i.id, i.title,i.filename, cm.name FROM images i INNER JOIN image_categories c ON i.id = c.imageid LEFT OUTER JOIN comments cm ON cm.parent_id = i.id AND c.catid = '#variables.catid#' GROUP BY i.id, i.title,i.filename, cm.name ORDER BY i.postdate desc, i.title </cfquery>
I am running this query on MySQL, and the problem is that no matter what #variables.catid# Is, it always brings up every image ... Basically I want to bring up every image that is defined by the 'variables.catid' and if there are comments, display the comments for that image ..(Not every image has comments, some have 1 some have 10). My output will be something like this: FILENAME1 (comments: 0) FILENAME2 (comments:2) FILENAME3 (comments 0) FILENAME4 (comments1) ect... Thank you Paul Giesenhagen QuillDesign ______________________________________________________________________ Your ad could be here. Monies from ads go to support these lists and provide more resources for the community. http://www.fusionauthority.com/ads.cfm FAQ: http://www.thenetprofits.co.uk/coldfusion/faq Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/ Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists