Move your  "c.catid = '#variables.catid#'" into the WHERE clause.

----- Original Message -----
From: "Paul Giesenhagen" <[EMAIL PROTECTED]>

<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).





______________________________________________________________________
This list and all House of Fusion resources hosted by CFHosting.com. The place for 
dependable ColdFusion Hosting.
FAQ: http://www.thenetprofits.co.uk/coldfusion/faq
Archives: http://www.mail-archive.com/[email protected]/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists

Reply via email to