CodeCharge Studio
search Register Login  

Web Reporting

Visually create Web Reports in PHP, ASP, .NET, Java, Perl and ColdFusion.
CodeCharge.com

YesSoftware Forums -> CodeCharge Studio -> PHP

 multi insert

Print topic Send  topic

Author Message
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


View profile  Send private message
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
View profile  Send private message
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

View profile  Send private message

Add new topic Subscribe to topic   


These are Community Forums for users to exchange information.
If you would like to obtain technical product help please visit http://support.yessoftware.com.

Internet Database

Visually create Web enabled database applications in minutes.
CodeCharge.com

Home   |    Search   |    Members   |    Register   |    Login


Powered by UltraApps Forum created with CodeCharge Studio
Copyright © 2003-2004 by UltraApps.com  and YesSoftware, Inc.