If anyone has a CF solution for this please share it. Thank YOU!
:) I saw your post and thought - hey, I can write that for this guy!
so here we go - oh, and this first section should work as I did test it just to make sure - I also included a bunch of comments so you could understand what is happening along the way.
I don't come through here - but I'll try to check back and make sure things worked out. otherwise - you can reach me through my biz site at
http://www.WebAndAudio.com========================================
===========
1) How do I parse the multiple values from the IPN and then insert it into the DB field seperated by commas?
===========
<!--- Set an empty variable for the list --->
<CFSET ItemList="">
<!--- run a loop over the fieldnames to extract only the ones called 'item_numberX' --->
<CFLOOP INDEX="TheField" list="#Form.FieldNames#">
<!--- item_number is 11 char long - so we make sure it's lower case and chop
the variable's name down before checking - and check if it is item_number,
if it is, you add it to the list --->
<cfif LCase(Left(Trim(TheField),11)) IS "item_number">
<CFSET ItemList = ListAppend(ItemList, Trim(Evaluate(TheField)))>
</cfif>
</CFLOOP>
<!--- now we have a list of item_numberX to insert into a field --->
<!--- use ItemList as your inserting variable --->
===========
2) How do I then later retrive and separate these values from the db field and display them like:
item_number1
item_number2
===========
<cfoutput query="YourSearch">
Order: #OrderID# Date:#DateFormat(OrderDate, 'mm/dd/yyyy')#
The following items were ordered:
</cfoutput>
<!--- run your query and set your orderId variable
which has the list to equal this db field --->
<cfset ItemList = "#YourSearch.item_numbers#">
<!--- /////////////// Option A \\\\\\\\\\\\\\ --->
<!--- If you wanted, right here you could ad a query on your item ids --->
<CFQUERY name="GetItems" datasource="#DataSource#">
Select *
From tblItems
Where ItemID IN (#ItemList#)
</CFQUERY>
<cfoutput query="GetItems">
<LI> #ItemName# - #ItemCost#</LI>
</cfoutput>
<!--- /////////////// OR Option B \\\\\\\\\\\\\\\\\\ --->
<!--- Or Loop over the list - output the index and a line break upon each loop --->
<BLOCKQUOTE>
<CFLOOP INDEX="i" list="#ItemList#">
<cfoutput>#i#<BR></cfoutput>
</CFLOOP>
</BLOCKQUOTE>