I need to design an online 'PC builder/customiser' similar to the one on the Dell website which allows users to customise their PCs before buying it. I've checked on the net for some scripts with similar functions but they don't seem as good as the Dell one! SO, I have decided to code my own in PHP/MySQL. BUT, i'm not sure on how to design it. This is the idea i have @ the moment: the page pulls the PCs components e.g. hard drive, memory, processor from a table and then displays them in separate drop down lists. When the user selects for example a 120GB hard drive from the menu, it updates the price displayed on the page. BUT, it also will need to detect imcompatible component configurations like attempting to buy an P4 motherboard with an AMD processor...Ideas anyone?
I forgot the post the tables i have...
Online Custom PC Builder
Date of join
Date last updated
Those weren't supposed to be part of the table. I was just listening different categories, sorry!
(Original post by piginapoke)
I'm not sure why you would want all those things in the category table as columns. How about:
category_id PRIMARY KEY, NOT NULL
category_name NOT NULL
This will allow you to create a hierarchy of categories. e.g.:
category_id = 1
category_name = motherboard
parent_category_id = null
category_id = 2
category_name = AMD motherboard
parent_category_id = 1
category_id = 3
category_name = Intel motherboard
parent_category_id = 1
which will allow your program to display products in a tree structure.
But if you're going down a 'wizard' style route where the various products are chosen in a specific sequence (e.g. processor then motherboard) then a hierarchy wouldn't be needed, just a more specific set of categories, then just use a query to select the appropriate motherboards after the processor has been chosen, e.g. if an AMD processor is selected (excuse the rusty SQL):
SELECT * FROM product, category
WHERE product.category = category.category_id
AND category.category_name = 'AMD Motherboard';
© Copyright The Student Room 2015 all rights reserved
The Student Room, Get Revising and Marked by Teachers are trading names of The Student Room Group Ltd.
Register Number: 04666380 (England and Wales), VAT No. 806 8067 22
Registered Office: International House, Queens Road, Brighton, BN1 3XE