If you haven’t already, you should start by designing your database, the PHP code will come later.
You say you have a database of products. What tables do you have in your database?
These are not tables, they are columns of one table.
So you have a products table.
You’ll need a categories table.
And you’ll have to decide:
A product can be part of only one category -> add a categoryid column to the products table
A product can be part of more categories -> you’ll need a productcategory table (which contains two columns: productid and categoryid) that will link products and categories together
I can enter a category such as Playstation but I dont know how to put this into a category of ‘Games Consoles’.
All I currently have is a sub-category.
Im looking to do this on multiple basis. For example sub-category of ‘xbox controller’ into ‘Games Controllers’.
Category: Sub-Category: Price: Description:
Games Console Playstation 3 £399.99 Playstation 3 Games Console with 3 Games
Games Controller XBox Controller £29.99 Wireless Xbox Contoller
Furniture TV Stand £249.99 Television Stand for 32" Flat Panel TV
So I would enter the category into a ‘Category’ column based on what is in the Sub-Category
For example when the code reads ‘TV Stand’ it would enter Furniture into the Category column.