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 4340988
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 21, 20262026-05-21T11:25:25+00:00 2026-05-21T11:25:25+00:00

ok so i have this problem that i need to achieve…Here is my site

  • 0

ok so i have this problem that i need to achieve…Here is my site

What i need to do is for each product sold i need to have 2 other products that are either an upgrade or a downgrade.

so there each product has 3 classes standard, business, and premium and based on what the current product is they either increase or decrease in price..

so basically they are customizing each solution. So what i need is figure out the best way to structure my db for this…here is the query i use to pull what i have now

 $query = "SELECT p.ProductName, p.price, pc.quantity, p.ProductImage, p.Features
            FROM productinfo as p
              join preconfig_categories as pc on p.ProductID = pc.product_id
              join preconfig as c on c.id = pc.category_id
              join subcategory as sc on p.SubCategoryID = sc.SubCategoryID
              WHERE  c.code      = '{$type}_{$count}_{$class}'
              order by sc.ordering";

I was thinking of in the productinfo table which is currently structured like this

CREATE TABLE `productinfo` (
  `ProductID` int(11) NOT NULL AUTO_INCREMENT,
  `ProductName` varchar(255) NOT NULL,
  `ProductImage` varchar(255) NOT NULL,
  `CategoryID` int(11) NOT NULL,
  `SubCategoryID` int(11) NOT NULL,
  `ProductBrief` varchar(255) NOT NULL,
  `Features` text NOT NULL,
  `Specifications` text NOT NULL,
  `Reviews` text NOT NULL,
  `Price` varchar(255) NOT NULL,
  `Status` tinyint(4) NOT NULL,
  `PartName` varchar(255) NOT NULL,
  `skip_step` tinyint(1) DEFAULT NULL,
  PRIMARY KEY (`ProductID`)
) ENGINE=MyISAM AUTO_INCREMENT=164 DEFAULT CHARSET=latin1;

I was thinking off adding three extra fields

class 
product1
product2

so basically i can use the class to tell what the current product is and then the other two fields product1 and product2 which will have the ProductID of the other two products….This seems like it could work but i feel like theres probably a better solution out there then can work a bit better….any ideas input would be strongly appreciated

  • 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-21T11:25:26+00:00Added an answer on May 21, 2026 at 11:25 am

    I would suggest have one table with the Product information. A second table with the class of product (Standard, Business, Premium) and then a third table where you map your client’s purchase to the product information ID and the Product Class ID.

    So if you need to add a new class of product in the future (Freeware, Premium Deluxe etc) you just add it to the Product Class table and then you can map this in the mapping table.

    So when a client purchases a product you map the Product ID and Product Class ID in the mapping table. If they downgrade, you update the mapping table to now map the Product ID to the downgraded Product Class ID.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

The problem is this: I have multiple competing threads (100+) that need to access
I have this problem that I can ref a button for control it. I
I have this problem that my sites uses alot of ajax and when a
Ok I have this problem that I've never had before, it's really bugging me.
So we have this problem that we are trying to figure out. Heres what
I have this problem decomposing a relation schema into a set of schemas that
I have a problem that I can't resolve. Let's say I have this map
I have this annoying problem, that Im pretty sure happens to all of you
I have this little problem, that I cannot figure out which arguments to pass
I'm working on a problem that uses pointer arithmetic and I have found this

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.