Ninjakreborn Posted October 4, 2010 Share Posted October 4, 2010 I have a general questions. 1. I have a list of products. 2. I have a list of each of the 50 states. 3. I have a list of "professions". I need to setup something called "State Verbiage". However, this is going to be on a per product, per state, per profession level. So each profession is mapped up to each state and product. So product #1, in State #4, for profession #2 would have verbiage. Any combination of the three would have different verbiage. Any advice on the easiest way to set this up, would be appreciated. Quote Link to comment https://forums.phpfreaks.com/topic/215138-question-general-thoughts/ Share on other sites More sharing options...
Adam Posted October 4, 2010 Share Posted October 4, 2010 Can you explain how verbiage applies to this exactly? Don't really understand what you're trying to do. Quote Link to comment https://forums.phpfreaks.com/topic/215138-question-general-thoughts/#findComment-1118941 Share on other sites More sharing options...
Ninjakreborn Posted October 4, 2010 Author Share Posted October 4, 2010 On the frontend a state and profession are selected. This is used to filter which products show up. For state verbiage I need to get the verbiage associated with that product/profession/state. The verbiage would change if any of these 3 things changed (profession, state, or product). I have a general idea of how i want to do it, but pulling all this on the frontend with PHP is going to get tricky. Wanted to see if anyone had any ideas to toss around before I tried the catch all mapping table and just pulled them out on a case by case basis. Quote Link to comment https://forums.phpfreaks.com/topic/215138-question-general-thoughts/#findComment-1118942 Share on other sites More sharing options...
Adam Posted October 4, 2010 Share Posted October 4, 2010 Sorry yeah, I see what you mean. Would a simple map table like this not do the trick..? verbal_id | product_id | state_id | profession_id | verbal_str 1 | 1 | 4 | 2 | 'Text for your example' Although thinking about it, performance would probably be better (and you'd be able to make the column unique) to join the various IDs within a single key: verbal_id | verbal_key | verbal_str 1 | '1:4:2' | 'Text for your example' But I guess it depends in what ways you'd be using the data. Quote Link to comment https://forums.phpfreaks.com/topic/215138-question-general-thoughts/#findComment-1118949 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.