This topic is locked

one list with values from 2 Tabels

10/19/2006 3:28:00 AM
PHPRunner General questions
M
mollyman01 author

Hello
please sorry me for my bad english
my problem
I have one Table Named Spieler and one Table AoP

in Spieler i have the Field "Name" and "Punkte"

the Tables are in master and Detail relationsship

"Spieler" is Master an the relation Field is "Name"

i would to display in List of "AoP" the Field "Punkte" from the "Spieler" table not from the
thanks for help

J
Jane 10/19/2006

Martin,
you can do it using join clause in the SQL query.

Proceed to the Edit SQL query tab (step 4) in the PHPRunner, check off Edit SQL query manually option and edit query for yourAoP table.

Here is a sample:

select `AoP`.`field1`,

`AoP`.`field2`,

`Spieler`.`Punkte`

from `AoP` inner join `Spieler`

on (`AoP`.`field1ID`=`Spieler`.`field2ID`)



where field1, field2, field1ID and field2ID are your actual field names.
If you'll have difficulties with this query you can post your table structure here and I'll help you.

M
mollyman01 author 10/21/2006

Hallo
thanks for the help
ich have the Problem
the Structure of the two tables is
Spieler

`Nation`,

`Name`,

`Spielerlink`,

`Gilde`,

`Punkte`,

`Punktedatum`,

`letzte-Punktekontrolle`
AoP

`Nation`,

`Name`,

`Link_Name`,

`Gilde`,

`X_Koord`,

`Y_Koord`,

`HI`,

`Punktedatum`,

`Farmbar`,

`Region`,

`letztes_Spionageergebnis_Lager`,

`letztes_Spionageergebnis_Militaer`,

`letzte_Spionage`
i'am Happy if you tell me how i must do ist
Thanks
Martin mollet

J
Jane 10/23/2006

Martin,
try to use following SQL query:

select `AoP`.`Nation`,

`AoP`.`Name`,

`Spieler`.`Punkte`,

`Link_Name`,

`Gilde`,

`X_Koord`,

`Y_Koord`,

`HI`,

`AoP`.`Punktedatum`,

`Farmbar`,

`Region`,

`letztes_Spionageergebnis_Lager`,

`letztes_Spionageergebnis_Militaer`,

`letzte_Spionage`

from `AoP` inner join `Spieler`

on (`AoP`.`Nation`=`Spieler`.`Nation` and `AoP`.`Name`=`Spieler`.`Name`)

M
mollyman01 author 10/24/2006

Martin,

try to use following SQL query:


Thanks for your Help
but if i enter the code in Edit SQL Query AoP i have this error "Failed to read servers response" what can i do ?
Greets Martin

J
Jane 10/25/2006

Martin,
sorry for my fault.

Here is the correct query:

select `AoP`.`Nation`,

`AoP`.`Name`,

`Spieler`.`Punkte`,

`Link_Name`,

`AoP`.`Gilde`,

`X_Koord`,

`Y_Koord`,

`HI`,

`AoP`.`Punktedatum`,

`Farmbar`,

`Region`,

`letztes_Spionageergebnis_Lager`,

`letztes_Spionageergebnis_Militaer`,

`letzte_Spionage`

from `AoP` inner join `Spieler`

on (`AoP`.`Nation`=`Spieler`.`Nation` and `AoP`.`Name`=`Spieler`.`Name`)