I hope I'm missing something really obvious here, because for the life of me I can't figure this one out at all!
I have a cfquery with some joins as follows;
SELECT f.*, p.ID AS prID, p.product_name, p.shortname, i.newthumb,
(SELECT AVG(reviewrating) FROM product_reviews AS pr WHERE pr.productid=p.id) AS reviewrating,
(SELECT description FROM product_descriptions AS d WHERE d.productid=p.id LIMIT 1) AS description
FROM followers_p f
LEFT JOIN products p
ON f.productID=p.ID
LEFT JOIN product_images i
ON i.productid=p.ID
WHERE f.wUserID='#getuser.wUserID#'
ORDER BY f.cID DESC
That executes fine and a cfdump of the query shows data is returned as it should be.
Further down the page, I'm running the cfoutput query. However, it's giving me an error 'Variable NEWTHUMB is undefined. '
I've tried grabbing the image as a subquery with Limit 1 and a few other things, but the result is always the same - cfdump shows the correct data, cfoutput gives an undefined error.
Anything else I can try to figure this one out? I've noticed a similar issue occurring on another page too.
Edit - the cfoutput code;
<cfoutput query="getproductfollow">
<a href="/#ID#/#shortname#"><img alt="#product_name#" src="#newthumb#"></a>
<a href="/#ID#/#shortname#">#product_name#</a></span>
</cfoutput>
cfoutputcode - James Hillsrc="#newthumb#"doessrc="#getproductfollow.newthumb#"work? - Matt Busche