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?
my first thought is that it's not necessary to explode with PHP.
this will return true for something like 'pool|fireplace|fitness' mysql_query('select id from theTable where amenities like "%pool%"')
you could make it more efficient by using boolean logic:
if 1=pool,2=fireplace,4=fitness, then 3=fireplace+pool, 5=fitness+pool, 7=fitness+fireplace+pool
just thoughts.
Kae
-- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php