I would keep it in one table. Structured properly, you could then have groups, sub-groups and categories, creating a hierarchy as deep as you want. It's more for future proofing your database than anything else.

Just add two more columns to your table, one for a parent id and one to indicate whether the record is a group or category. That last one isn't absolutely necessary since a record is a group or category depending on whether it has child records or not. A single query with a self join will be able to tell you if a record is a group or category.

On Wednesday, February 5, 2003, at 05:21 PM, Andrew Maynes wrote:

I have a set of records in a mysql table that are called categories. A query
pulls all the records for category and in turn this are then <links> to items of
that said category. Simple. Ok here is the bit I want some feeback on. I want
to create another table (if this is the solution) and split the category into
groups, this is for the purpose of navigation. So istead of having 30
categories I will have X number of goups with categories in X group.

Do I need to create another table to do this (as we did with the ref_colour) or
can I split the output in a simple way with creating a table.
--
Brent Baisley
Systems Architect
Landover Associates, Inc.
Search & Advisory Services for Advanced Technology Environments
p: 212.759.6400/800.759.0577


---------------------------------------------------------------------
Before posting, please check:
  http://www.mysql.com/manual.php   (the manual)
  http://lists.mysql.com/           (the list archive)

To request this thread, e-mail <[EMAIL PROTECTED]>
To unsubscribe, e-mail <[EMAIL PROTECTED]>
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php

Reply via email to