Jon,

Here is what I have done for that issue.  Session.BasketItems hold the
unique ID number for the SKU (Products) and Session.BasketCount is the
associated list of quantities for each item. Or to put it another way
listProducts=Session.BasketItems and listQuantity=Session.BasketCount

<!--- Now query the SKU Table to get the items --->
<cfquery name="GetBasket" datasource="#application.db#" dbtype="ODBC">
        SELECT      SKU_ID, SKU_NO, SKU_SHORTDESC, SKU_LONGDESC, SKU_COLOR,
                                        SKU_LIST, SKU_SALE, SKU_RATINGS, SKU_WEIGHT
        FROM         SKUTable
        WHERE 0=0 and (0 = 1
                <cfloop index="ii" list="#Session.BasketItems#">
                        OR SKU_ID = #ii#
                </cfloop>
                        )
</cfquery>

<cfoutput query="GetBasket">
<!--- Now find the QTY for the correct Item ID --->
<cfset
SKU_QTY=ListGetAt(Session.BasketCount,ListFind(Session.BasketItems,SKU
_ID))>

<!--- Now Display the QTY for the correct Item ID --->
#SKU_NO# - #SKU_QTY#
</cfoutput>


Best Regards,

Dennis Powers
UXB Internet
(203)879-2844
http://www.uxbinfo.com

-----Original Message-----
From: Jon Tillman [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, August 01, 2000 10:17 AM
To: [EMAIL PROTECTED]
Subject: Re: Looping through lists


I have two lists, listProducts and listQuantity. I want to do the
following:

For each productID in listProducts, do a search that returns all the
relevant
info about the product, display it in a table, and add the quantity
listed in
listQuantity. What I need to know is how to make sure that
listQuantity returns
only one value for each iteration of the CFOUTPUT loop. any ideas? If
this
makes no sense at all, let me know and I will email you what I have so
far, by
way of explanation.

--
This Email is 100% Virus Free! How do I know?
Because no Microsoft products were used to
generate it!

:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
 Jon Tillman
 LINUX USER: #141163
 ICQ: 4015362
 [EMAIL PROTECTED]
 http://tillman.freehosting.net
:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
----------------------------------------------------------------------
--------
Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/
To Unsubscribe visit
http://www.houseoffusion.com/index.cfm?sidebar=lists&body=lists/cf_tal
k or send a message to [EMAIL PROTECTED] with
'unsubscribe' in the body.

------------------------------------------------------------------------------
Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/
To Unsubscribe visit 
http://www.houseoffusion.com/index.cfm?sidebar=lists&body=lists/cf_talk or send a 
message to [EMAIL PROTECTED] with 'unsubscribe' in the body.

Reply via email to