Jump to content

Question - General thoughts


Ninjakreborn

Recommended Posts

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.

Link to comment
https://forums.phpfreaks.com/topic/215138-question-general-thoughts/
Share on other sites

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.

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.

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.