This topic is locked

Many to many relationships

9/9/2020 9:09:00 AM
PHPRunner General questions
V
Vladimir_V author

Hello.

The question is simple for advanced users, but difficult for me.

I am trying to create many to many relationships as in tutorial

https://xlinesoft.com/blog/2011/02/28/how-to-setup-many-to-many-relationships/

https://vimeo.com/20306453
But this tutorial very old
In MySQL workbench (InnoDB) adding many to many relationships is clear for me, but not in PHPRunner.
2 day I try implement many to many relationships as in tutorial, nothing good happened because the link table no have ID

Before:

Office_Employee

OfficeID PK

EmployeeID PK
After:

Office_Employee

ID PK AI

OfficeID

EmployeeID
This working same as in tutorial (no need throw an error in case of a duplicate, now is one checkbox "Prevent duplicate values")
I use add new record an if I add new Employee i see error: "Unknown column 'name' in 'field list'".

I already give up, I can not configure adding a record to the table Employee from detail tab. May be somebody have tutorial for this? Or new way working with many-to-many relationships.

S
skbrasil 9/9/2020



Hello.

The question is simple for advanced users, but difficult for me.

I am trying to create many to many relationships as in tutorial

https://xlinesoft.com/blog/2011/02/28/how-to-setup-many-to-many-relationships/

https://vimeo.com/20306453
But this tutorial very old
In MySQL workbench (InnoDB) adding many to many relationships is clear for me, but not in PHPRunner.
2 day I try implement many to many relationships as in tutorial, nothing good happened because the link table no have ID

Before:

Office_Employee

OfficeID PK

EmployeeID PK
After:

Office_Employee

ID PK AI

OfficeID

EmployeeID
This working same as in tutorial (no need throw an error in case of a duplicate, now is one checkbox "Prevent duplicate values")
I use add new record an if I add new Employee i see error: "Unknown column 'name' in 'field list'".

I already give up, I can not configure adding a record to the table Employee from detail tab. May be somebody have tutorial for this? Or new way working with many-to-many relationships.


##########################################################################################################################

As your example is not very clear, I recommend adding a sample sql code.
In your case to make a relationship between the tables you have two options:
Option one to do the relationship using the Query Designer tab
https://xlinesoft.com/phprunner/docs/query_designer.htm
Remembering that to make the union between sql tables you have to have a key in common, in which they are shared between the tables.
If you want to make a relationship with details see the documentation below:
https://xlinesoft.com/phprunner/docs/master-details.htm
ex: http://sqlfiddle.com/#!2/b7c18/2

Admin 9/11/2020

That article may be old but the idea of how to handle many to many relationships hasn't changed since databases were invented. The idea is to have a crossref table.
I'm not quite sure where that 'name' column is coming from but it looks like you missed the unset part in the article.

V
Vladimir_V author 9/16/2020



That article may be old but the idea of how to handle many to many relationships hasn't changed since databases were invented. The idea is to have a crossref table.
I'm not quite sure where that 'name' column is coming from but it looks like you missed the unset part in the article.


I try to explane more:




















I made few changes, but after add record i see empty row:




I think problem with unset part, but how to see feature.name and desc?

V
Vladimir_V author 9/17/2020

I try Use different settings for all pages:





And I not see inline tab
For example:

Set in inline tab for 'name' field type read only and get value from autofill...

Set in Add tab for 'name' field type text field for adding and saving value in 'feature' table.
I think in this case user no need use unset part.