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
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
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.