Question
Array? List? Collection? Loop?
I have a form that uses cfselect where the user can select
multiple items. I am sending the category id to the next page. When
I do a dump of the form for #form.category# I get the correct items
in a "list" as in " 184, 450, 38, 233". On the next page I need to
select the category names for all the id's the user selects.(They
can select 1-400) This is throwing me off on how to set up the item
in order to even start the query.
I tried stripping out individual items using this
<cfset firstcat = Right(form.category, Len(trim(form.category))- Find(",",form.category,1))>
That worked for the first one but isn't their a better way to do this dynamically since I'm not going to know how many categories they select. My deliminater is the comma
Then how do I set the query up in order to select one or more categories?
Select * from cat_area where area_id = '#trim(firstcat)#' - this obviously only works for the 1st category.
I've been trying arrays and lists but I think I can't see the forest for the trees anymore. Any help would be greatly appreciated. Thanks
I tried stripping out individual items using this
<cfset firstcat = Right(form.category, Len(trim(form.category))- Find(",",form.category,1))>
That worked for the first one but isn't their a better way to do this dynamically since I'm not going to know how many categories they select. My deliminater is the comma
Then how do I set the query up in order to select one or more categories?
Select * from cat_area where area_id = '#trim(firstcat)#' - this obviously only works for the 1st category.
I've been trying arrays and lists but I think I can't see the forest for the trees anymore. Any help would be greatly appreciated. Thanks
