Re: select * from table where column 'CONTAINS' more than one value (how?)

From: Date: Wed, 22 Jun 2005 05:35:13 +0000
Subject: Re: select * from table where column 'CONTAINS' more than one value (how?)
References: 1  Groups: php.db 
Request: Send a blank email to php-db+get-39736@lists.php.net to get a copy of this message
I have no problem creating a table, using a query from my dbase table "news": SELECT * FROM table where column = VALUE. However, now that most of our articles have more than one column type (i.e. instead of just technology, the column can now contain "technology, politics, local".
You need to normalize your tables. Make a table called columntypes, then another called articlecolumntypes. If you have an article with ID 456, and it has column types of technology (ID 5), politics (ID 15), and local (ID 34), you tie the articles table to the columntypes table using the articlecolumntypes table: articleid columntypeid --------- ------------
456        5
456        15
456        34
--df

« previous php.db (#39736) next »