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
I assume your form returns the category IDs for each category selected and that those IDs correspond with category_id in your categories table.
First you insert your business record into your business table, this will give you the auto increment number (mysql_insert_id function in PHP or whatever function for the library you are using). So, you have an $idfromfunction somewhere stored.
With that business ID, then loop through your category IDs
(perhaps already having used):
SELECT category_id, category_name
FROM categories
(... and showed this list to your user through checkboxes or drop list or whatever)
After the user chooses one $categoryidfromform, you can then insert into your tbl_works_categories table
INSERT INTO tbl_works_categories
(bus_id, category_id)
VALUES
( $idfromfunction, $categoryidfromform) ;