Thanks for responding. That's what I believed by previous code did -- 
looping over the list and replacing it with a line feed. I have tried 
replacing the commas with a <br> tag instead of a line feed, but I'm 
still left with a long string, this time substituting the commas with a 
<br> tag.  So, the list becomes Tall Pepperweed<br> Perennial 
Pepperweed, etc.

What I want to do is this: query the db. If there is a record that is 
comma-delimited within the field, remove the commas and output each 
entry on a separate line.

Since the Replace statement merely replaces the comma with a CRLF and 
doesn't output each entry on a separate line, it looks like I would need 
to do a loop within a loop. If that is so, then my question is how?

I know I'm probably missing something very obvious.


Adrian Lynch wrote:

>If it's in the DB as a list, why not pull it out and then loop through it
>putting a <br> after each iteration of the loop?
>
>Ade
>
>-----Original Message-----
>From: Shirley [mailto:[EMAIL PROTECTED]]
>Sent: 20 September 2002 13:20
>To: CF-Talk
>Subject: Re: Looping
>
>
>Part of my problem is database design, where  CSV lists are allowed in a 
>field name. I know I have to correct this and  create a separate table.
>
>However, for now, some of the records are quite long. For example here's 
>the unabridged record that I alluded to in my previous message: Tall 
>Whitetop, Tall Pepperweed, Perennial Pepperweed, Giant Whiteweed, 
>Perennial Peppergrass, Slender Perennial Peppergras, Broadleaf, 
>Broad-leaved Pepperweed, Ironweed). So, you can imagine this list would 
>stretch across the screen.  So, that's why I need to break apart the list.
>
>If the entires were shorter, I would use the simple method you pointed 
>out. Any other suggestions? Thanks.
>
>Thomas Chiverton wrote:
>
>>>After querying the database, I want to loop over these records and 
>>>output them in the following format, so that I can use them in a Select 
>>>List:
>>>
>>Any reason not to just do something like this, or use <cfselect> :
>>
>><select>
>><CFOUTPUT QUERY="getcommonnames">
>>      <option>#Common_Names#</option>
>></CFOUTPUT>
>></select>
>>
>>?
>>
>>Tom Chiverton
>>You don't have to be a mad scientist to believe in ColdFusion
>>
>>
>>
>>
>>
>
>
______________________________________________________________________
Structure your ColdFusion code with Fusebox. Get the official book at 
http://www.fusionauthority.com/bkinfo.cfm
FAQ: http://www.thenetprofits.co.uk/coldfusion/faq
Archives: http://www.mail-archive.com/[email protected]/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists

Reply via email to