Why are youre aproaches incorrect? Maybe it is possible to modell it like this:
CLASS :: PLANT { specie text sort text catogory enum {pant, flower, bush, etc...} price decimal nr_in_stock integer ... } CLASS :: FEATURE { shape enum Domian {tall, round,...} color enum Domain {red, blue, white,...} ... } Of cource this model is dependet (as usually) on what the customer what to store and how they would like to be able to search in the database. My point is: it is *very* important to do feature study *with* the cusotmer to establish what excatly they want to do. If one does not have this information it is very hard to judge on a design and the qulaity of the design. Anyhow. assume abowe classes: Then PLANT should have a non dependent relation with FEATURE and FEATURE will have a dependet realtion with PLANT In the DB you might end up with two tables this way: PLANT_TABLE and FEATURE _TABLE. Now a costomer will be abl;e to search on categories but also be able to narow down i this with special features of these catgories. Using states or bolean wont really utilize the power of a RDBMS in they way it was thought of in the begining. M<y recommendation is that you very carfully study what they want to have, and the make a datamodell (on papper) first, and the explain the feature of this data modell for the cusotmer, then they might have a chanse to say yes or no to your ideas and you can redesign it on papper (itterative development). Remeber it goes quit fast to change a drawing on a papper while it might take month establish changes in an almost implimented system. -----Original Message----- From: Bobo Wieland To: [EMAIL PROTECTED] Sent: 7-6-03 11:07 Subject: [PHP-WIN] Bitwize operations Hi! [LONG EXPLAINATION OF THE PROBLEM (questions further down)] I'm about to create a MySQL db for a company dealing with plants (trees and bushes and that sort of thing). Now a user should be able to search for a specific plant in this db - but that specific plant could come in many different shapes or forms or what-ever, but it is still the same plant... I've thought about adding the same plant many times in the db, wich isn't logical correct or have one fields for each state that the plants come in. but that won't be correct either. Now, I'm thinking like this; One table for all states and one field in the main plant table for which states in the states-table that should be used... [...QUESTION 1] Is there some built in operation/operators/functions for dealing with bitwize operations in PHP/MySQL? I would like a feild in the MySQL table 1 to store (perhaps) the value 0000 0101 (or 5) and that should tell PHP to get the information from the MySQL table 2 where the primary key equals 1 and 4: table 2 | pri_key | info | | 1 | aaldkjkjskiiejifr.... | | 2 | aaldkjkjskiiejifr.... | | 4 | aaldkjkjskiiejifr.... | | 8 | aaldkjkjskiiejifr.... | | 16 | aaldkjkjskiiejifr.... | | 32 | aaldkjkjskiiejifr.... | ..... [...QUESTION 2] Is this the best way to do what I'm about to do or is there some better way? well... that's it I suppose... .bobo -- PHP Windows Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php