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 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 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
Archived
This topic is now archived and is closed to further replies.