s_ceccoli
Posts: 3
|
| Posted: 08/20/2009, 3:03 AM |
|
i have a editable grid for insert
this grid must insert some data in a first table end work it but when it must insert some data,in a second table, through custom code in after execute insert and dont work!!!.
example:
after execute insert
$db = new clsDBardis();
$SQL="INSERT INTO verbaliaggiuntivi (id_tipo_verbale,Data,id_ufficiale,notiziedireato_Protocollo_ardis,notiziedireato_Data_prot_ardis) VALUES (".$db->ToSQL($Container->DataSource->id_tipo_verbale->GetValue(),ccsInteger).","
.$db->ToSQL($Container->DataSource->id_ufficiale->GetValue(),ccsInteger).","
.$db->ToSQL($Container->DataSource->Protocollo_ardis->GetValue(),ccsInteger).","
.$db->ToSQL($Container->DataSource->Data_prot_ardis->GetValue(),ccsInteger).")";
$db->query($SQL);
$db->close();
i have made a test, echo $SQL and i see that the value are (null,null,null,33,33) but i insert all value in that field form.
why that value?
why dont write in the second table?
thanks
|
 |
 |
jjrjr1
Posts: 942
|
| Posted: 08/20/2009, 9:17 AM |
|
Looks to me that you have 5 fields to update but only have 4 values for the table. I think that will cause a MySql error and no update will occur.
_________________
John Real - More CodeCharge Studio Support at - http://CCSElite.com |
 |
 |
s_ceccoli
Posts: 3
|
| Posted: 08/20/2009, 11:51 PM |
|
sorry but my write error,in the original code there is a code for data
The editable gris use a custom insert property with code sql where i have set the property only fields to the first table (notiziedireato)
db = new clsDBardis();
$SQL="INSERT INTO verbaliaggiuntivi (id_tipo_verbale,Data,id_ufficiale,notiziedireato_Protocollo_ardis,notiziedireato_Data_prot_ardis) VALUES (".$db->ToSQL($Container->DataSource->id_tipo_verbale->GetValue(),ccsInteger).","
.$db->ToSQL($Container->DataSource->Data->GetValue(),ccsData).","
.$db->ToSQL($Container->DataSource->id_ufficiale->GetValue(),ccsInteger).","
.$db->ToSQL($Container->DataSource->Protocollo_ardis->GetValue(),ccsInteger).","
.$db->ToSQL($Container->DataSource->Data_prot_ardis->GetValue(),ccsInteger).")";
$db->query($SQL);
$db->close();
thx
|
 |
 |
|