Ok, Nick, here we go again 😉
Drop the parent column on categories table.
Drop cat_id column from links table.
Drop the column name as the pk of cateogries table.
Create a table CAT_PARENT_GRP
with CAT_ID,PARENT_ID columns.
Create a link_cat_grp table with CAT_ID ID columns.
So, now you sohuld have this:
links
id|title|url
cat_parent_grp
cat_id|parent_id
link_cat_grp
cat_id|id
categories
cat_id|name
Enter a couple categories into the categories table. So that it becomes clear, only enter three (COLORS,BOOKS,CARS)
Now, in the cat_parent_grp table enter the id numbers for these three example categories with 0 as the parent id. These three categories no reprenst the top level of your category tree.
Now, enter these links into the links table (www.colors.com,www.books.com,www.cars.com).
In the link_cat_grp table, enter the corresponding id's for these three links, with the cat_id that matches (in this example it's obvious.)
And now, technically you are done.... but wait. Lets say you have an idea. That idea is to add www.pastels.com to your book mark list. It definitely would follow under the "color"category, but you want to define that even further. So, what you would do is this:
Enter "www.pastels.com" into your links table.
Enter "pastels" into your categories table.
Enter the cat_id for the pastels cateogry into the cat_parent_grp.cat_id column, with the cat_parent_grp.parent_id value being the cat_id for the "colors" category.
Lastly, enter the id from the links table for "pastels" into the links_cat-grp table, with the cat_id for pastels found in categories talbe.
Get that far, and see if it starts to make sense. I'll walk you through the rest once you get that far. (Don't worry, when we're all done, you'll be a wiz at this and it will be clear as a bell.)