Custom Insert with columns not needed in client?

I’ve tried the whole day to get an insert into the 2 tables of the database but it didn’t work. I think there are some issues/problems withe the following things:

  1. The Select statetment:
$grid->render_sql("SELECT lc.LogCallID, lc.Source, lc.Num, lc.Msg, lcd.LcdID, lcd.LogCallID, lcd.Application, lcd.LogLevel, lcd.Text_en_US FROM SYS_LogCalls lc JOIN SYS_LogCallDescription lcd ON lc.LogCallID = lcd.LogCallID", "", "LogCallID,Source,Num,Msg,LcdID,LogCallID,Application,LogLevel,Text_en_US");

The problem here is that i on client side in the table only 6 of the 9 columns must be shown and editable (Source, Num, Msg of table 1 and Application, LogLevel, Text_en_US from table 2).
Is it possible that LogCallID (primary key in table 1, foreign key in table 2) and LcdID (primary key in table 2) are not shown in table on client side?
How do i have to make the insert function for this?
Here is my code that doesn’t work:

[code]function insert1($action)
{
$id = $action->get_id();
$source = $action->get_value(“Source”);
$num = $action->get_value(“Num”);
$msg = $action->get_value(“Msg”);

        mysql_query("INSERT INTO SYS_LogCalls (LogCallID, Source, Num, Msg) VALUES ('{$id}', '{$source}', '{$num}', '{$msg}')");

        $action->success();
    }$grid->event->attach("beforeInsert","insert1");[/code]

Do not wonder why i only make an insert for table 1 because i wanted to try if he does insert in 1 table at all.
How do i have to make a function for inserting the six needed columns (Source, Num, Msg table 1 / Application, LogLevel, Text_en_US table2) into the database?
How is it possible to insert the values of LogCallID and LcdID into the tables when writing the insert statement? I’ve tried a lot of things but he didn’t insert a value for the keys (auto increment).
That is what the logfile says when i tried to insert values by trying two methods (beforeInsert,afterInsert):

[code]====================================
Log started, 22/07/2010 04:07:30

SELECT lc.LogCallID, lc.Source, lc.Num, lc.Msg, lcd.LcdID, lcd.LogCallID, lcd.Application, lcd.LogLevel, lcd.Text_en_US FROM SYS_LogCalls lc JOIN SYS_LogCallDescription lcd ON lc.LogCallID = lcd.LogCallID LIMIT 0,100

SELECT COUNT(*) as DHX_COUNT FROM SYS_LogCalls lc JOIN SYS_LogCallDescription lcd ON lc.LogCallID = lcd.LogCallID

Done in 0.0044801235198975s

====================================
Log started, 22/07/2010 04:07:37

DataProcessor object initialized
1279807297068_gr_id => 1279807297068
1279807297068_c0 =>
1279807297068_c1 =>
1279807297068_c2 =>
1279807297068_c3 =>
1279807297068_c4 =>
1279807297068_c5 =>
1279807297068_c6 =>
1279807297068_c7 =>
1279807297068_c8 =>
1279807297068_!nativeeditor_status => inserted
ids => 1279807297068

BEGIN

Row data [1279807297068]
=> 1279807297068
LogCallID =>
Source =>
Num =>
Msg =>
LcdID =>
Application =>
LogLevel =>
Text_en_US =>
!nativeeditor_status => inserted

INSERT INTO SYS_LogCalls lc JOIN SYS_LogCallDescription lcd ON lc.LogCallID = lcd.LogCallID(LogCallID,Source,Num,Msg,LcdID,LogCallID,Application,LogLevel,Text_en_US) VALUES (’’,’’,’’,’’,’’,’’,’’,’’,’’)

ROLLBACK

Edit operation finished
0 => action:error; sid:1279807297068; tid:1279807297068;

Done in 0.0064880847930908s

====================================
Log started, 22/07/2010 04:07:40

DataProcessor object initialized
1279807297068_gr_id => 1279807297068
1279807297068_c0 =>
1279807297068_c1 => dsafdsaf
1279807297068_c2 =>
1279807297068_c3 =>
1279807297068_c4 =>
1279807297068_c5 =>
1279807297068_c6 =>
1279807297068_c7 =>
1279807297068_c8 =>
1279807297068_!nativeeditor_status => inserted
ids => 1279807297068

BEGIN

Row data [1279807297068]
=> 1279807297068
LogCallID =>
Source => dsafdsaf
Num =>
Msg =>
LcdID =>
Application =>
LogLevel =>
Text_en_US =>
!nativeeditor_status => inserted

INSERT INTO SYS_LogCalls lc JOIN SYS_LogCallDescription lcd ON lc.LogCallID = lcd.LogCallID(LogCallID,Source,Num,Msg,LcdID,LogCallID,Application,LogLevel,Text_en_US) VALUES (’’,‘dsafdsaf’,’’,’’,’’,’’,’’,’’,’’)

ROLLBACK

Edit operation finished
0 => action:error; sid:1279807297068; tid:1279807297068;

Done in 0.003385066986084s

====================================
Log started, 22/07/2010 04:07:49

DataProcessor object initialized
1279807297068_gr_id => 1279807297068
1279807297068_c0 =>
1279807297068_c1 => dsafdsaf
1279807297068_c2 => 123546
1279807297068_c3 =>
1279807297068_c4 =>
1279807297068_c5 =>
1279807297068_c6 =>
1279807297068_c7 =>
1279807297068_c8 =>
1279807297068_!nativeeditor_status => inserted
ids => 1279807297068

BEGIN

Row data [1279807297068]
=> 1279807297068
LogCallID =>
Source => dsafdsaf
Num => 123546
Msg =>
LcdID =>
Application =>
LogLevel =>
Text_en_US =>
!nativeeditor_status => inserted

INSERT INTO SYS_LogCalls lc JOIN SYS_LogCallDescription lcd ON lc.LogCallID = lcd.LogCallID(LogCallID,Source,Num,Msg,LcdID,LogCallID,Application,LogLevel,Text_en_US) VALUES (’’,‘dsafdsaf’,‘123546’,’’,’’,’’,’’,’’,’’)

ROLLBACK

Edit operation finished
0 => action:error; sid:1279807297068; tid:1279807297068;

Done in 0.0037100315093994s

====================================
Log started, 22/07/2010 04:07:52

DataProcessor object initialized
1279807297068_gr_id => 1279807297068
1279807297068_c0 =>
1279807297068_c1 => dsafdsaf
1279807297068_c2 => 123546
1279807297068_c3 => sdafdsafsdaf
1279807297068_c4 =>
1279807297068_c5 =>
1279807297068_c6 =>
1279807297068_c7 =>
1279807297068_c8 =>
1279807297068_!nativeeditor_status => inserted
ids => 1279807297068

BEGIN

Row data [1279807297068]
=> 1279807297068
LogCallID =>
Source => dsafdsaf
Num => 123546
Msg => sdafdsafsdaf
LcdID =>
Application =>
LogLevel =>
Text_en_US =>
!nativeeditor_status => inserted

INSERT INTO SYS_LogCalls lc JOIN SYS_LogCallDescription lcd ON lc.LogCallID = lcd.LogCallID(LogCallID,Source,Num,Msg,LcdID,LogCallID,Application,LogLevel,Text_en_US) VALUES (’’,‘dsafdsaf’,‘123546’,‘sdafdsafsdaf’,’’,’’,’’,’’,’’)

ROLLBACK

Edit operation finished
0 => action:error; sid:1279807297068; tid:1279807297068;

Done in 0.0025389194488525s

====================================
Log started, 22/07/2010 04:07:18

SELECT lc.LogCallID, lc.Source, lc.Num, lc.Msg, lcd.LcdID, lcd.LogCallID, lcd.Application, lcd.LogLevel, lcd.Text_en_US FROM SYS_LogCalls lc JOIN SYS_LogCallDescription lcd ON lc.LogCallID = lcd.LogCallID LIMIT 0,100

SELECT COUNT(*) as DHX_COUNT FROM SYS_LogCalls lc JOIN SYS_LogCallDescription lcd ON lc.LogCallID = lcd.LogCallID

Done in 0.0014598369598389s

====================================
Log started, 22/07/2010 04:07:19

DataProcessor object initialized
1279807459444_gr_id => 1279807459444
1279807459444_c0 =>
1279807459444_c1 =>
1279807459444_c2 =>
1279807459444_c3 =>
1279807459444_c4 =>
1279807459444_c5 =>
1279807459444_c6 =>
1279807459444_c7 =>
1279807459444_c8 =>
1279807459444_!nativeeditor_status => inserted
ids => 1279807459444

BEGIN

Row data [1279807459444]
=> 1279807459444
LogCallID =>
Source =>
Num =>
Msg =>
LcdID =>
Application =>
LogLevel =>
Text_en_US =>
!nativeeditor_status => inserted

Event code for insert processed

COMMIT

Edit operation finished
0 => action:inserted; sid:1279807459444; tid:1279807459444;

Done in 0.0691978931427s

====================================
Log started, 22/07/2010 04:07:23

DataProcessor object initialized
1279807459444_gr_id => 1279807459444
1279807459444_c0 =>
1279807459444_c1 => dsafdsf
1279807459444_c2 =>
1279807459444_c3 =>
1279807459444_c4 =>
1279807459444_c5 =>
1279807459444_c6 =>
1279807459444_c7 =>
1279807459444_c8 =>
1279807459444_!nativeeditor_status => updated
ids => 1279807459444

BEGIN

Row data [1279807459444]
=> 1279807459444
LogCallID =>
Source => dsafdsf
Num =>
Msg =>
LcdID =>
Application =>
LogLevel =>
Text_en_US =>
!nativeeditor_status => updated

UPDATE SYS_LogCalls lc JOIN SYS_LogCallDescription lcd ON lc.LogCallID = lcd.LogCallID SET LogCallID=’’,Source=‘dsafdsf’,Num=’’,Msg=’’,LcdID=’’,LogCallID=’’,Application=’’,LogLevel=’’,Text_en_US=’’ WHERE =‘1279807459444’

ROLLBACK

Edit operation finished
0 => action:error; sid:1279807459444; tid:1279807459444;

Done in 0.00341796875s

====================================
Log started, 22/07/2010 04:07:25

DataProcessor object initialized
1279807459444_gr_id => 1279807459444
1279807459444_c0 =>
1279807459444_c1 => dsafdsf
1279807459444_c2 => 13132312
1279807459444_c3 =>
1279807459444_c4 =>
1279807459444_c5 =>
1279807459444_c6 =>
1279807459444_c7 =>
1279807459444_c8 =>
1279807459444_!nativeeditor_status => updated
ids => 1279807459444

BEGIN

Row data [1279807459444]
=> 1279807459444
LogCallID =>
Source => dsafdsf
Num => 13132312
Msg =>
LcdID =>
Application =>
LogLevel =>
Text_en_US =>
!nativeeditor_status => updated

UPDATE SYS_LogCalls lc JOIN SYS_LogCallDescription lcd ON lc.LogCallID = lcd.LogCallID SET LogCallID=’’,Source=‘dsafdsf’,Num=‘13132312’,Msg=’’,LcdID=’’,LogCallID=’’,Application=’’,LogLevel=’’,Text_en_US=’’ WHERE =‘1279807459444’

ROLLBACK

Edit operation finished
0 => action:error; sid:1279807459444; tid:1279807459444;

Done in 0.0016419887542725s

====================================
Log started, 22/07/2010 04:07:27

DataProcessor object initialized
1279807459444_gr_id => 1279807459444
1279807459444_c0 =>
1279807459444_c1 => dsafdsf
1279807459444_c2 => 13132312
1279807459444_c3 => dfsdsafds
1279807459444_c4 =>
1279807459444_c5 =>
1279807459444_c6 =>
1279807459444_c7 =>
1279807459444_c8 =>
1279807459444_!nativeeditor_status => updated
ids => 1279807459444

BEGIN

Row data [1279807459444]
=> 1279807459444
LogCallID =>
Source => dsafdsf
Num => 13132312
Msg => dfsdsafds
LcdID =>
Application =>
LogLevel =>
Text_en_US =>
!nativeeditor_status => updated

UPDATE SYS_LogCalls lc JOIN SYS_LogCallDescription lcd ON lc.LogCallID = lcd.LogCallID SET LogCallID=’’,Source=‘dsafdsf’,Num=‘13132312’,Msg=‘dfsdsafds’,LcdID=’’,LogCallID=’’,Application=’’,LogLevel=’’,Text_en_US=’’ WHERE =‘1279807459444’

ROLLBACK

Edit operation finished
0 => action:error; sid:1279807459444; tid:1279807459444;

Done in 0.0097308158874512s
[/code]
I would be very greatful if you could help me with this!