This topic is locked

master-details: one-to-one relations

6/29/2006 10:00:18 AM
PHPRunner General questions
K
ken.stessens@telenet.be author

Hello,
I was wondering what would be the most elegant way to define one-to-one master-details relations in the PHPrunner.
Let's take an example: say I'm selling pens and rulers. I put them both in the general products list, but for every product type I create a different table for the description of that particular type:

  • pens do write in a certain color which you can or cannot refill
  • rulers have a certain length with a certain division
    Assume I have following tables:

    products [id,pn,type<pen, ruler>,...]

    pens[id,color,refill,...]

    rulers [id,length,resolution,...]
    So one product should correspond to exactly one description, and this description should be read from the appropriate data table depending on the product type.
    Thanks for your help!

    Ken

Alexey admin 6/30/2006

Ken,
I recommend you to create an additional DescriptionURL character field in products table.

Then put there the links to appropriate Pens or Rulers View pages.

I.e.

pens_view?editid=10

rulers_view?editid=11



Set up this field as Hyperlink on Formatting tab in PHPRunner.