Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6196299
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T03:37:08+00:00 2026-05-24T03:37:08+00:00

for a current customer project, i’ve developed a CMS that stores products . Products

  • 0

for a current customer project, i’ve developed a CMS that stores products.

Products are entries that have some properities like title, text & etc.
However, some clients want to have different properties like price, color & etc.

I try to make my code as generic as possible so i don’t want to modify the code
for each customer.

My Question:
How can i design such a database, that a product can have infinite, multiple properties?
How to create/generate forms for such a different design?

Thanks for reading.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-24T03:37:09+00:00Added an answer on May 24, 2026 at 3:37 am

    you need to have two tables:

    CREATE TABLE products( product_id INT, product_name VARCHAR, ... );
    CREATE TABLE product_properties( product_id INT, property_name VARCHAR, property_value VARCHAR );
    

    The first table contains one product per row with their unique ID and their common properties

    --------------------------------------------------------
    |  id  |      name       |   other common properties...
    --------------------------------------------------------
    |  1   |      apple      |   ...
    |  2   |      bentley    |
    |  3   |      ...        |
    |  ... |      ...        |
    

    The second table relates each product to its non-common properties:

    ----------------------------------------------------
    | id   |    property_name   |    property_value    |
    ----------------------------------------------------
    |  1   |    color           |    red               |
    |  1   |    size            |    large             |
    |  2   |    wheel count     |    4                 |
    |  2   |    top speed       |    200               |
    |  2   |    airbags         |    yes               |
    |  ... |    ...             |    ...               |
    

    You get a product’s information with two queries, first you get the common properties:

    SELECT product_name, ... FROM products WHERE product_id = 2
    

    then the non-common properties:

    SELECT property_name, property_value FROM product_properties WHERE product_id = 2
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

In a current project, I have a model called Box that stores items from
Our current scenario is like this: we have an existing database that needs to
On my current project I'm using SQL CE. Since it doesn't have support for
In my current project in cakephp, there are different roles for different users like
After working on a page for quite some time, the customer now decided that
On the current project I'm working on, we have the following problem. Our software
Current, I've got a stored procedure that has a main goal of doing a
My current development project has two aspects to it. First, there is a public
My current project is in Rails. Coming from a Symfony (PHP) and Django (Python)
I have created a simply Pizza program (for a summer project not education related)

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.