目录 - 将产品分类

I am building a catalog of products and need to assign the exact categories to the item.

There are f.ex. 10 main categories with subcategories, stored in a MySQL database.

What should be a good way to allow user to go accross categories from the highest level to the lowest and select the right one? Especially if you can select more than one category for the product?

Example: I have a banana and need to save it into:

Categories
-- colors
--- yellow

and also to

Categories
-- Fruits
--- Exotic

Currently I have two selectboxes - one selexts fro mthe main categories and the second from the subcategories. But it is a bit complicated, non user friendly and also works just with JS enabled.

Is there a ncier way how to do that? The amount of subcategories is in hundreds.

Thanks in advance.