I would have another table, related_wigets, with the following structure:
widgetid (number, PK, FK)
related_widgetid (number, PK, FK)
When someone wants to relate widget with widgetid = 1 to widget with widgetid = 2, do an insert like so:
INSERT INTO related_widgets (widgetid, related_widgetid)
VALUES (1, 2)
When you want a full list of which widgets are related to widget with widgetid = 3, the following query will give you a complete list:
SELECT * FROM related_widgets
WHERE widgetid = 3 OR related_widgetid = 3
Hope this helps,
darkagn
There are no stupid questions, only those too stupid to ask for help.
echo is a web developer's best friend.