I'm currently in the process of writing a real estate listings program
and I am not sure what the best approach is for storing and searching
through the property amenities. Example: houses or apartment amenities
can be a pool, fitness center, spa, etc.

Users must be able to search for listings within a specific price range,
location, amenities, or other criteria. 

I can think of two ways of doing this:

The first approach, I can have the facilities table with all available
property, a table with all available amenities, and then another table
that will serve as an index where I will make use of foreign keys to
link property to amenities.

The second approach is to store amenities as a text delimited string for
each property in the facilities table. So if a certain property has a
pool, fireplace and fitness center, I would have
'pool|fireplace|fitness' in the amenities field. I can then use PHP to
explode or create an array so that I can manipulate the string.

Anybody have any thoughts or advice on this?

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to