RE: [PHP-DB] DB design

From: Date: Wed, 20 Dec 2000 18:02:46 +0000
Subject: RE: [PHP-DB] DB design
Groups: php.db 
Request: Send a blank email to php-db+get-5365@lists.php.net to get a copy of this message
Personally I would make three tables: 1. A table of catagories 2. A table of 'items' (which you have) 3. A table that holds item ids and ctagory ids. with PK being both fields. If you need me to expand on that, let me know =) Sean -----Original Message----- From: Tom Harris [mailto:stry_cat@yahoo.com] Sent: Wednesday, December 20, 2000 12:44 PM To: php-db@lists.php.net Subject: [PHP-DB] DB design Here's my problem... Each item in my database can belong to several of 50 categories. Right now I'm using a text field which contains a string of letters representing each category. (i.e. item A belongs to categories one and five so it's category field is " ONE FIV " To find data I use a select statement with a WHERE category LIKE "% FIV %" which gets everything that belongs to category 5.) What I want to know is there a better way to do this? It is possible that the number of categories will double in the near future. I'm using PHP 4.0.3 and MySQL 3.22.32 to create a dynamic website, right now it's getting may hits, but it is possible that could change as well. Thanks, -Tom -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, e-mail: php-db-unsubscribe@lists.php.net For additional commands, e-mail: php-db-help@lists.php.net To contact the list administrators, e-mail: php-list-admin@lists.php.net

« previous php.db (#5365) next »