bcoffin Posted April 2, 2009 Share Posted April 2, 2009 Table: Assets {id, asset_name} Table: Attributes {id, option} Table: Assets_Attributes {asset_id, option_id} Assets_Attributes might look like 1, 1 1, 2 2, 1 3, 1 4, 1 4, 2 4, 3 I get how to select asset_name where an option is found (ex: option_id 2 would yield asset_name for asset_id 1,4) But how about if i want the ability to provide multiple option_id(s)? (ex: option_id 1 would yield asset_name for asset_id 1,2,3,4) (ex: option_id 1,2 would yield asset_name for asset_id 1,4) (ex: option_id 1,2,3 would yield asset_name for asset_id 4) Thanks Quote Link to comment https://forums.phpfreaks.com/topic/152160-solved-probably-a-lot-easier-than-i-think-please-help/ Share on other sites More sharing options...
bcoffin Posted April 2, 2009 Author Share Posted April 2, 2009 I guess doing something like this is the easiest: ... AND assets.id IN (2,4,5,6,7, AND assets.id IN (1,3,5,6,7, ... where each row is a delimited array of assets.id(s) found for each unique option. this can be very easily scalable. nm Quote Link to comment https://forums.phpfreaks.com/topic/152160-solved-probably-a-lot-easier-than-i-think-please-help/#findComment-799136 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.