Re: Unlimited Categories and Sub-Categories

From: Date: Sun, 10 Sep 2000 15:51:58 +0000
Subject: Re: Unlimited Categories and Sub-Categories
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-16069@lists.php.net to get a copy of this message
I was thinking about combining category numbers in a string, and putting that in one field in the user table. Do you think that will be fast and reliable?
I did this for www.MusicThoughts.com and it worked really well. Each "thought" can have multiple categories. There are 12 categories now, for example, but soon there might be 30. I just gave each category a letter, and made a small "varchar()" field to store the string in. So if thought id#231 is in categories a, h, p, and y, then its category field just says "ahpy" If you allow each user a maximum of 7 categories, for example, you'd only need a "varchar(7)" field. It's VERY easy to pass this in a URL and then separate it into an array on any page that needs it.

« previous php.general (#16069) next »