fazzfarrell Posted February 6, 2007 Share Posted February 6, 2007 i have two databases CREATE TABLE `holdbacks` ( `ID` int(11) NOT NULL auto_increment, `ProdRel` text NOT NULL, `Style` text NOT NULL, `Type` text NOT NULL, `Name` text NOT NULL, `Lemgth` text NOT NULL, `CatID` text NOT NULL, `Pix` text NOT NULL, `Misc` text NOT NULL, PRIMARY KEY (`ID`) ) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=3 ; CREATE TABLE `poles` ( `ID` int(11) NOT NULL auto_increment, `ProdRel` text NOT NULL, `Style` text NOT NULL, `Type` text NOT NULL, `Name` text NOT NULL, `Lemgth` text NOT NULL, `CatID` text NOT NULL, `Pix` text NOT NULL, `Misc` text NOT NULL, PRIMARY KEY (`ID`) ) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=3 ; The poles are the main products, the holdbacks are associated products. I want to display the poles on the page via the 'Type' Which I have (the ref is 'E') but I want under each entry. the associated products which comes from the Holdbacks table. Each pole and holdback has a ProdRef (eg 1,2,3 or 4 etc). any one help? Quote Link to comment Share on other sites More sharing options...
fenway Posted February 6, 2007 Share Posted February 6, 2007 Well, you can get back all of the pairings with a JOIN, but you'll still have to handle the "each entry" part yourself. Quote Link to comment Share on other sites More sharing options...
fazzfarrell Posted February 8, 2007 Author Share Posted February 8, 2007 ? Not sure what you mean? Quote Link to comment Share on other sites More sharing options...
fazzfarrell Posted February 8, 2007 Author Share Posted February 8, 2007 Dont know if I explained my self properly, I need to end up with all my products on a page then a drop down menu displaying the colours for each product Quote Link to comment Share on other sites More sharing options...
fenway Posted February 8, 2007 Share Posted February 8, 2007 What i meant was that you can join the products & product colours, and get a result set of all of the pairs. However, you'll have to keep track of when the product name changes as you iterate though the result set, so that you can deal with the output accordingly. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.