Jump to content

associated data


fazzfarrell

Recommended Posts

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?

 

Link to comment
https://forums.phpfreaks.com/topic/37300-associated-data/
Share on other sites

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.

Link to comment
https://forums.phpfreaks.com/topic/37300-associated-data/#findComment-179939
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.