【发布时间】:2012-03-09 12:39:59
【问题描述】:
我希望我在这里遗漏了一些非常明显的东西,因为我这辈子根本无法弄清楚这一点!
我有一个带有如下连接的 cfquery;
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
执行良好,查询的 cfdump 显示数据按原样返回。
在页面的下方,我正在运行 cfoutput 查询。但是,它给了我一个错误'变量 NEWTHUMB 未定义。 '
我尝试将图像作为具有限制 1 和其他一些内容的子查询来抓取,但结果始终相同 - cfdump 显示正确的数据,cfoutput 给出未定义的错误。
还有什么我可以尝试解决这个问题的吗?我注意到另一个页面上也发生了类似的问题。
编辑 - cfoutput 代码;
<cfoutput query="getproductfollow">
<a href="/#ID#/#shortname#"><img alt="#product_name#" src="#newthumb#"></a>
<a href="/#ID#/#shortname#">#product_name#</a></span>
</cfoutput>
【问题讨论】:
-
请发布您的
cfoutput代码 -
是的,向我们展示这个:“在页面下方,我正在运行 cfoutput 查询。”
-
道歉 - 我已将 cfoutput 代码添加到原始帖子中。
-
如果你确定你的变量范围会改变什么吗?
src="#getproductfollow.newthumb#"代替你src="#newthumb#"工作吗?
标签: coldfusion