This topic is locked

please help me

6/11/2007 5:55:52 AM
PHPRunner General questions
M
mr.jim author

I read this
1-

SELECT EmployeeAddressTable.EmployeeIDNo,

EmployeeAddressTable.FirstName,

EmployeeAddressTable.LastName,

EmployeeStatisticsTable.Salary

FROM EmployeeAddressTable, EmployeeStatisticsTable

WHERE EmployeeAddressTable.EmployeeIDNo = EmployeeStatisticsTable.EmployeeIDNo


2-

SELECT EmployeeAddressTable.EmployeeIDNo,

EmployeeAddressTable.FirstName,

EmployeeAddressTable.LastName,

EmployeeStatisticsTable.Salary

FROM EmployeeAddressTable INNER JOIN EmployeeStatisticsTable

ON EmployeeAddressTable.EmployeeIDNo = EmployeeStatisticsTable.EmployeeIDNo


I have same case,
I try both of them, and both work in view, but which one I must use to edit/add values from both tables? and how?
I need to edit values from 2 tables with 1:1 relation like the example above.
can you help me please,
thanks all,
jim

L
leckey 6/11/2007

I read this

1-

SELECT EmployeeAddressTable.EmployeeIDNo,

EmployeeAddressTable.FirstName,

EmployeeAddressTable.LastName,

EmployeeStatisticsTable.Salary

FROM EmployeeAddressTable, EmployeeStatisticsTable

WHERE EmployeeAddressTable.EmployeeIDNo = EmployeeStatisticsTable.EmployeeIDNo


2-

SELECT EmployeeAddressTable.EmployeeIDNo,

EmployeeAddressTable.FirstName,

EmployeeAddressTable.LastName,

EmployeeStatisticsTable.Salary

FROM EmployeeAddressTable INNER JOIN EmployeeStatisticsTable

ON EmployeeAddressTable.EmployeeIDNo = EmployeeStatisticsTable.EmployeeIDNo


I have same case,
I try both of them, and both work in view, but which one I must use to edit/add values from both tables? and how?
I need to edit values from 2 tables with 1:1 relation like the example above.
can you help me please,
thanks all,
jim

L
leckey 6/11/2007

Have you read the PHPRunner Manual? It has info about Master-Relationships.

See info below from the manual. Have you setup the relationship between the two tables first windows of using PHPRunner?
A one-to-many relationship, often referred to as a "master-detail" or "parent-child" relationship, is the most usual relationship between two tables in a database.
Common scenarios include customer/purchase data, patient/medical-record data, and student/course-result data. For example, each customer is associated with at least one order record. Valued customers have many order records involving significant sums and often a user needs to view one in connection with the other. In a one-to-many relationship, a record in Table A can have (none or one or) more than one matching record in Table B, but for every record in Table B there is exactly one record in Table A.
For example, say you have Orders table and Order Details table , where order number is a common field in each. You can create a master-detail relationship that will enable you to navigate through the Orders and jump to Order Details that belong to current order only.
You might need to add a new field to details table (integer, autoincrement) and use it as a key column, in the table that is related to the master table.
Hope this helps.