It sounds like you've started coding without thinking about the design, and frankly, it sounds like you would benefit from more than just "an idea" now that you are stuck.

But in the spirit of careful-what-you-wish-for, here's an idea:

Add a column "plan_id" to your plan table, this will link to tables described below.

Make a third table called "features", and include these columns

Make a fourth table called "plan_features", and include these columns

The plan_features table links the plans table to the features table in a many-to-many relationship.

Make a fifth table called "feature_valid_values", and include these columns

This table contains valid values for each feature, such as "yes", "no", "unlimited". You don't need this table if you don't care what values are used for each feature.

Can you see how this hangs together? The idea is that each distinct set of information (groups, plans, features, feature values) has its own identity, and relates to other sets of information in a specific way.


In reply to Re: Creation Suggestion needed... please by EdwardG
in thread Creation Suggestion needed... please by ukndoit

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.