Results 1 to 4 of 4
  1. #1
    Join Date
    Mar 2010
    Posts
    8

    Unanswered: Help me get over this bump

    I'm struggling to figure this out. I was able to a few years ago, but my knowledge has slagged.

    I'm create a practice run web-app to look for web hosting.

    Database model:

    Host -> Plans

    Host can have many plans
    Plans can be of different types (shared, reseller, VPS etc.)
    Hosts can have reviews (just URLs)

    Hosts are easy.
    Plans is where I'm drawing dead.

    Do I just need to create a table for each type or do I just have an "attribute" table and have one of the "plan" fields be "attributes".

    Thanks for any help,
    I hope I get MyIQ back.

  2. #2
    Join Date
    Apr 2002
    Location
    Toronto, Canada
    Posts
    20,002
    Quote Originally Posted by tmcarstens View Post
    Do I just need to create a table for each type or do I just have an "attribute" table
    at this point, neither

    Quote Originally Posted by tmcarstens View Post
    ... and have one of the "plan" fields be "attributes".
    nor this

    each host will have separate plans, and to start out, you do not need the hassle of "pre-defining" a plan before you can add a host

    just create the host_plans table using a 2-part PK, the hostid plus the plan name, and go ahead and use a VARCHAR for the plan name
    rudy.ca | @rudydotca
    Buy my SitePoint book: Simply SQL

  3. #3
    Join Date
    Mar 2010
    Posts
    8
    The problem I have (or difficulty getting my head around) is that in the host_plans table I'll have to define things like: space allocated, bandwidth, RAM etc. And for shared for instance a RAM value wouldn't be specified but for a VPS it would. Do I just leave them empty and not display the values that are null when throwing it at the reseller_result template (for instance)?

    Thanks for the help!

  4. #4
    Join Date
    Apr 2002
    Location
    Toronto, Canada
    Posts
    20,002
    Quote Originally Posted by tmcarstens View Post
    Do I just leave them empty and not display the values that are null when throwing it at the reseller_result template (for instance)?
    yes, that seems like the way to do it
    rudy.ca | @rudydotca
    Buy my SitePoint book: Simply SQL

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •