[thelist] CF_Shoppingcart, aligning lists (REPOST?)
Joshua Olson
joshua at alphashop.net
Fri Jul 13 12:31:24 CDT 2001
Jeff, you wrote:
: sounds to me like you'll have to get funky with the query to make this
work.
: how about something like this:
:
: <cfif Val(shoppingcart_items)>
: <cfquery name="getall" datasource="#db#">
: SELECT moduleid,
: modulesnip,
: (SELECT 1
: FROM module) AS quantity
: FROM module
: WHERE moduleid IN (#shoppingcart_product#)
: </cfquery>
: </cfif>
Why not:
<cfif Val(shoppingcart_items)>
<cfquery name="getall" datasource="#db#">
SELECT moduleid,
modulesnip,
1 AS quantity
FROM module
WHERE moduleid IN (#shoppingcart_product#)
</cfquery>
</cfif>
?
Also, so databases do not allow the IN clause to contain more than 255
unqiue values... not that it is likely that a person will have more than
that many items in their basket.
-joshua
More information about the thelist
mailing list