relational table help

From: Date: Mon, 30 Oct 2000 04:26:48 +0000
Subject: relational table help
Groups: php.db 
Request: Send a blank email to php-db+get-4031@lists.php.net to get a copy of this message
Hello, I'm using PHP with MySQL on UNIX box running Apache and I need some help relating two tables... I have a table called Contact which holds records with standard contact info (ContactID [unique], Name, Add1, Add2, State, Country, Zip, URL). Each of these contacts falls into one or more Categories ... I have a Categories table (CategoryID [unique], CategoryName) ... And I have a CategoryContact (CategoryID, ContactID) table where I keep track of which Contacts fall into which Catgeories ... so if for example a Contact with a ContactID=7 qualified for Category X (which has a Category ID=1) and also qualified for Category Y (which has a CategoryID=2), than there would be to rows in CatgeoryContact ... 7,1 and 7,2. How do I display all the Contacts that qualify for a particular Category? Please help! Thanks, Nick

« previous php.db (#4031) next »