This topic is locked

Fieldsdifferences in List an Edit

3/16/2009 3:57:05 AM
PHPRunner General questions
W
webdino author

I have created a view with a sql join over some tables
SELECT `WD`.Bestellfelder, `WD`.DirektLieferung, `U`.user_name, `L`.Lieferantennname

FROM ((DIRLIEFERUNG `WD`

INNER JOIN Lieferanten `L`

ON (`WD`.LieferantenID = `L`.LieferantenID))

INNER JOIN users `U`

ON (`WD`.MarktID = `U`.user_id))

ORDER BY `U`.user_name ASC
I would show Username in Listpage instead of ID. But when I try to change the data in Edit Page I had an error like
"Unknown table 'WD' in where clause".

The field of the join Tables where not activatet in add and edit page. There are lookups in the dropdown fields for these values.

Why does it not works to change these values and save it into my database?

J
Jane 3/16/2009

Hi,
try to use this SQL:

SELECT belaos_WERBUNG_DIRLIEFERUNG.Bestellfelder, belaos_WERBUNG_DIRLIEFERUNG.DirektLieferung, belaos_users.user_name, elaos_WERBUNG_Lieferanten.Lieferantennname

FROM ((belaos_WERBUNG_DIRLIEFERUNG

INNER JOIN belaos_WERBUNG_Lieferanten

ON (belaos_WERBUNG_DIRLIEFERUNG.LieferantenID = elaos_WERBUNG_Lieferanten.LieferantenID))

INNER JOIN belaos_users

ON (belaos_WERBUNG_DIRLIEFERUNG.MarktID = belaos_users.user_id))

ORDER BY belaos_users.user_name ASC

W
webdino author 3/16/2009

it works when I don´t use Table aliases thank you