Hi Patric,

You might be better off by creating lookup tables for your criteria, and
performing the search using a join, rather than storing the lists of
matching criteria.

Simply make a table with hotel_ID (whatever the primary key is) and the
primary key of the criteria item.  It might look like this:

Hotel_ID        Criteria_ID
1               21
1               14
1               13
1               3
2               12
2               21
2               10

and so on.  The criteria table would look like:

Criteria_ID     CriteriaText
1               Swimming Pool
2               Family Friendly
3               24 Hour Room Service
5               Concierge
6               Business Center

and so on.

While making it far easier to retrieve values, it also makes maintenance and
modification much simpler.

Good luck!

Jeff B.

-----Original Message-----
From: Patric Stumpe [mailto:[EMAIL PROTECTED]]
Sent: Saturday, January 13, 2001 10:01 AM
To: CF-Talk
Subject: Comparing 2 Lists in a query


Hi folks,

I actually got a problem I don't know how to solve. I have form-page where
you can search for hotels. You can enter the city, the zip-code and enter
some check some criterias the hotel should have like family-friendly, allow
pets, swimming-pool and so on. These criterias are checkboxes with name
'merkale' and each criteria has it's own number as value. The hotels have
also a list 'merkmale' in the table 'hotels'.
My problem is how to check if all the list-values in 'form.merkmale' from
the search-page are in 'hotels.merkmale'. I tried it with a loop in the
query but i can't figure out the right syntax. The values from the
search-page are properly posted to the result page.

So I hope anyone can help.

Thanks in advance...

Patric Stumpe
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Structure your ColdFusion code with Fusebox. Get the official book at 
http://www.fusionauthority.com/bkinfo.cfm

Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists

Reply via email to