This topic is locked

Add Edit Pages on inner join

10/28/2006 5:42:29 PM
PHPRunner General questions
M
mmponline author

I got itright to create the following inner join:
select `NameID`,

`Name`,

`Surname`,

`NmeID`,

`AdID`,

`Ad1`,

`Town`,

`Code`

From `Name`

inner join Ads on (Name.NameID=Ads.AdID)
and it works fine.
How do I setup the Add and Edit page to be able to add/edit info from both tables.
Iget the following error:

The INSERT INTO statement contains the following unknown field name: 'NmeID'. and everytime I remove the field, the next in the Ads table.

Alexey admin 10/30/2006

Stephan,
there is no support for editing multiple tables on one page in PHPRunner.

You can implement this using events.
To get this working you'll need to update joined table manually and then remove joined fields from $values array in BeforeEdit/BeforeAdd events.

Here is the sample code:

global $conn;

$strSQL = "update Ads set ad1='".$values["Ad1"]."' ... where AdId='".$values["AdId"]."'";

db_exec($strSQL,$conn);

unset($values["Ad1"]);

unset($values["AdId"]);