I do have this already, so what you are saying is then loop over a list of number which are related to the second table, in other words:
SELECT * FROM t_records, t_topics WHERE t_records.ID_record = t_topics.ID_topics Right? Even in this case, I would still have a list of numbers in one field in the t_records tabl to loop through - the record could be associated with topic a, topic b, topic c, and so on. Mark -----Original Message----- From: Douglas L. Brown [mailto:[EMAIL PROTECTED]] Sent: Sunday, November 25, 2001 6:07 PM To: CF-Talk Subject: Re: Loop a db field you should have 2 tables, one for the records and one for the topics relate to the records. In IE table records recordID (pri key) records table recordTopics topicID(pri key w/ foreign key relationship to your records table) topics Doug ----- Original Message ----- From: "Mark Leder" <[EMAIL PROTECTED]> To: "CF-Talk" <[EMAIL PROTECTED]> Sent: Sunday, November 25, 2001 2:50 PM Subject: RE: Loop a db field > So how do I fix where the list of topics for one record could be 10 topics > or 60 topics or 100? Build 100 field to contain the data? > > Mark > > -----Original Message----- > From: Dina Hess [mailto:[EMAIL PROTECTED]] > Sent: Sunday, November 25, 2001 5:32 PM > To: CF-Talk > Subject: Re: Loop a db field > > > Each field in a properly structured relational database should contain > no more than one value. Fix that and your current "problem" goes away. > > ----- Original Message ----- > From: Mark Leder > To: CF-Talk > Sent: Sunday, November 25, 2001 3:24 PM > Subject: Loop a db field > > > I have an Access db with a field entitled "topics". This is a memo > field > with a comma separated list of text values, such as attitude, image, > change > management, etc. > > When I submit a form using a drop down box to pick the word > "attitude", how > do I set up the query on the results page to loop through all the > records in > that field to find and output the results of the word "attitude"? (I > need to > return all fields in the db for display purposes, such as name, > address, > etc.) > > <cfquery name = "q_foo" datasource = db1" > SELECT * from t_list > ORDER BY lastname > </cfquery> > > <cfloop .... </cfloop> > > Thanks, > Mark > > > ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Get the mailserver that powers this list at http://www.coolfusion.com FAQ: http://www.thenetprofits.co.uk/coldfusion/faq Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/ Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists