This topic is locked

Connection between master table and details table

1/6/2019 2:44:10 PM
PHPRunner General questions
R
robert.drygas author

Hello!
I have a problem with creating connection between master table and details table (as it is described in the user manual). Take a look at this, please http://www.robert.waw.pl/example
This is a very simple database. It contains only two tables: master table and detals table. The structure of the master table is:

  • ID int(11)
  • m_name varchar(50)
  • m_author varchar(50)
  • m_description varchar(50)
  • m_id_details varchar(50)
    The structure of the details table is:
  • ID int(11)
  • d_name varchar(50)
  • d_description (50)
    The link is set between master_table.m_id_details (as master) and details_table.ID (as details).
    Properties of master_table.m_id_details for edit is set to lookup wizard with database table:
  • Table = details_table
  • Link field = ID
  • Display field = d_name
  • Allow multiple selection is checked
  • Allow to add new values on the fly is checked
    The problem appear when I add second detail entry to m_id_details field. The record count on the badge stay as "1" not as "2" and after unfold there is no detail tables.
    What am I doing wrong?
    PHPRunner 10 Enterprise
    --

    Robert Drygas

HJB 1/6/2019



Hello!
I have a problem with creating connection between master table and details table (as it is described in the user manual). Take a look at this, please http://www.robert.waw.pl/example
This is a very simple database. It contains only two tables: master table and detals table. The structure of the master table is:

  • ID int(11)
  • m_name varchar(50)
  • m_author varchar(50)
  • m_description varchar(50)
  • m_id_details varchar(50)
    The structure of the details table is:
  • ID int(11)
  • d_name varchar(50)
  • d_description (50)
    The link is set between master_table.m_id_details (as master) and details_table.ID (as details).
    Properties of master_table.m_id_details for edit is set to lookup wizard with database table:
  • Table = details_table
  • Link field = ID
  • Display field = d_name
  • Allow multiple selection is checked
  • Allow to add new values on the fly is checked
    The problem appear when I add second detail entry to m_id_details field. The record count on the badge stay as "1" not as "2" and after unfold there is no detail tables.
    What am I doing wrong?
    PHPRunner 10 Enterprise
    --

    Robert Drygas


https://xlinesoft.com/phprunner/docs/master-detailes.htm
Screenshots under point "4. Now master-details relationship is created and displayed as arrow between tables" refer ..., does the ARROW point correctly at your end?

Tandy 1/7/2019

<br />Hello!<br /><br />I have a problem with creating connection between master table and details table (as it is described in the user manual). Take a look at this, please <a href='http://www.robert.waw.pl/example'; class='bbc_url' title='External link' rel='nofollow'>http://www.robert.waw.pl/example</a><br /><br />This is a very simple database. It contains only two tables: master table and detals table. The structure of the master table is:<br /><br />- ID int(11)<br />- m_name varchar(50)<br />- m_author varchar(50)<br />- m_description varchar(50)<br />- m_id_details varchar(50)<br /><br />The structure of the details table is:<br /><br />- ID int(11)<br />- d_name varchar(50)<br />- d_description (50)<br /><br />The link is set between master_table.m_id_details (as master) and details_table.ID (as details).<br /><br />Properties of master_table.m_id_details for edit is set to lookup wizard with database table:<br /><br />- Table = details_table<br />- Link field = ID<br />- Display field = d_name<br /><br />- Allow multiple selection is checked<br />- Allow to add new values on the fly is checked<br /><br />The problem appear when I add second detail entry to m_id_details field. The record count on the badge stay as &quot;1&quot; not as &quot;2&quot; and after unfold there is no detail tables.<br /><br />What am I doing wrong?<br /><br />PHPRunner 10 Enterprise<br /><br /><br />--<br />Robert Drygas<br />

<br /><br /><br />
I am doing sort of the same thing..
But here is how I have mine.
Master Table

  • ID int(11)
  • m_name varchar(50)
  • m_author varchar(50)
  • m_description varchar(50)
    The structure of the details table is:
  • ID int(11)
  • MASTER-ID int(11)
  • d_name varchar(50)
  • d_description (50)
    Then set the link from Master Table: ID to Details Table: MASTER-ID
    Hope that helps. I am the one that hit Test on your site

A
ayctech 1/8/2019

is enabled?

T
thamestrader 1/14/2019

The fields you are using to link are incorrect.
Master table needs a unique key, ideally an auto-increment field - the ID lets call it M_ID
The Detail table needs a unique key ,ideally an auto-increment field - the ID lets call it D_ID, the Detail table also needs a field to hold the ID of the related Master record, lets call this D_M_id.
Master is linked to Detail by linking (joining) M_ID to D_M_id, this is a 1 to many relationship, there is no need to duplicate actual data from the master in the detail, it will just cause problems in the future.

R
robert.drygas author 1/20/2019

First of all, I apologize for a long absence.
Thank you guys for your help. It seems that I did it the opposite way and it did not work. Now I think it works well :-)
But I still need some help. I altered the database - I added one more table "Author Table", it is very simple table:
ID int(11)

author_name varchar(50)
and I linked "m_author" from "Master Table" to ID of this new "Author Table". I would like to choose the author or authors from the list and to display as values in the appropriate column (not as a detail table). In Master Table I set author field as lookup wizard connected to Author Table.
Generally it works but not filtering :-(
When I select two authors (or more), the filter shows for example
[ ] Robert, John
but I would like it to be
[ ] Robert

[ ] John
How can I do this?