Re: [PHP] Categories like wordpress

[email protected] (Richard Heyes)
Newsgroups php.general
Message-ID <[email protected]>
> Is this how its done or am I barking up the wrong tree?

You have multiple options:

1. Fully normalised, where you have three tables - one for your
    "articles", one for your categories and a link table.
2. A "SET" MySQL datatype which will allow upto 32 predefined
    categories.
3. A simple CHAR type with the category names, (or if you use numeric
    IDs, you could have many more categories).

The former is, IIRC, faster, but more work to implement. Whereas the 
latter two are very fast to implement but somewhat slower to query. For 
the last two cases the MySQL function FIND_IN_SET() will be very useful.

-- 
Richard Heyes

+----------------------------------------+
| Access SSH with a Windows mapped drive |
|    http://www.phpguru.org/sftpdrive    |
+----------------------------------------+
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.