[thelist] Nested CFOUPUT Problem (Need help fast!)
Frank
framar at interlog.com
Mon May 8 07:15:44 2000
At 8:14 PM +0930 5/8/00, isaac forman wrote:
>
>Can I see the queries?
>
>
>If I have a query ("getthem"), and I'm matching it with a URL
>variable from the
>query string, I'd do something like this:
>
> <cfif #getthem.whateverid# is #url.whateverid#>selected</cfif>
>
>If I had a query ("onesupplier") which returned one row, and my full query was
>"allcatfoodsuppliers", then my code would be:
>
> <cfoutput query="allcatfoodsuppliers">
> <option value="#id#
> <cfif #supplierid# is #onesupplier.supplierid#>selected</cfif>
> >#suppliername#</option>
> </cfoutput>
>
>Perhaps the problem is that there are multiple products in the select element
>with the supplierid in question?
(sorry about the wrapping)
Actually, it turns out (I think) that I should be using some sort of
relationship. Here's what I've done, I'm still getting an error. Can
you spot it?
<!--- Get the product's current information --->
<cfquery name="GetProduct" datasource="#DS#" maxrows=1>
SELECT
Products.*, ProdCustom.Custom1, ProdCustom.Custom2,
ProdCustom.Custom3, ProdCustom.Custom4, ProdCustom.Custom5,
ProdCustom.Custom6, Suppliers.ID
FROM Products
LEFT OUTER JOIN ProdCustom
ON Products.Product_ID = ProdCustom.Product_ID
-- MINE
LEFT OUTER JOIN Suppliers
ON Products.Supplier = Suppliers.ID
-- /MINE
WHERE Products.Product_ID = #Product_ID#
</cfquery>
--
Frank Marion Loofah Communications
frank@loofahcom.com http://www.loofahcom.com