I have a database which takes user submitted data, the entries from which I want to group under one or several of about 10 categories.
So for example, you add your entr
To get a business data with all categories you can do,
SELECT bus.*, cat.category_name FROM business bus
JOIN tbl_works_categories twc USING (bus_id)
JOIN categories cat USING (category_id)
WHERE bus.bus_id = ?
To retrieve business data from category name, just switch the WHERE param
SELECT bus.*, cat.category_name FROM business bus
JOIN tbl_works_categories twc USING (bus_id)
JOIN categories cat USING (category_id)
WHERE cat.category_name = ?