Hello,
When I change a value (not province), an error occurs: not the province_id is entered, but the province_name, the record is NOT saved into the database.
[code]DataProcessor object initialized
3_gr_id => 3
3_c0 => Family residence 65
3_c1 => Frung street 1023
3_c2 => Guang Torpkwa
3_c3 => Grinhime
3_c4 => WA 23809
3_c5 => 023-304 59 00
3_!nativeeditor_status => updated
ids => 3
Row data [3]
marker_id => 3
name => Family residence 65
address => Frung street 1023
city => Guang Torpkwa
province_id => Grinhime
zipcode => WA 23809
phone => 023-304 59 00
!nativeeditor_status => updated
UPDATE markers SET name=‘Family residence 65’, address=‘Frung street 1023’, city=‘Guang Torpkwa’, province_id=‘Grinhime’, zipcode=‘WA 23809’, phone=‘023-304 59 00’ WHERE marker_id=‘3’
Edit operation finished
0 => action:error; sid:3; tid:3;
[/code]
When I change the province from the pull-down, the record is saved into the database.
[code]
DataProcessor object initialized
3_gr_id => 3
3_c0 => Family residence 65
3_c1 => Frung street 1023
3_c2 => Guang Torpkwa
3_c3 => 7
3_c4 => WA 23809
3_c5 => 023-304 59 00
3_!nativeeditor_status => updated
ids => 3
Row data [3]
marker_id => 3
name => Family residence 65
address => Frung street 1023
city => Guang Torpkwa
province_id => 7
zipcode => WA 23809
phone => 023-304 59 00
!nativeeditor_status => updated
UPDATE markers SET name=‘Family residence 65’, address=‘Frung street 1023’, city=‘Guang Torpkwa’, province_id=‘7’, zipcode=‘WA 23809’, phone=‘023-304 59 00’ WHERE marker_id=‘3’
Edit operation finished
0 => action:updated; sid:3; tid:3;[/code]
[code]
<?php $res = mysql_connect("host","username","password"); mysql_select_db("database"); require("dhtmlxConnector/codebase/grid_connector.php"); require("dhtmlxConnector/codebase/combo_connector.php"); $gridConn = new GridConnector($res); $gridConn->enable_log("markers_log.txt"); $filter1 = new OptionsConnector($res); $filter1->render_sql(" SELECT province_id as value, province_name as label FROM provinces", "province_id", "province_id(value), province_name(label)"); $gridConn->set_options("province_name",$filter1); $gridConn->dynamic_loading(100); $gridConn->sql->attach("update", "UPDATE markers SET name='{name}', address='{address}', city='{city}', province_id='{province_id}', zipcode='{zipcode}', phone='{phone}' WHERE marker_id='{marker_id}'"); //$gridConn->sql->attach("insert", // "INSERT INTO markers (name,address,city,province_id,zipcode,phone) // VALUES ('{name}','{address}','{city}','{province_id}','{zipcode}','{phone}')"); if ($gridConn->is_select_mode()) //code for loading data { $gridConn->render_sql(" SELECT marker_id, name, address, city, markers.province_id, province_name, zipcode, phone FROM markers,provinces WHERE markers.province_id=provinces.province_id" , "marker_id", "name,address,city,province_name,zipcode,phone"); } else //code for other operations - i.e. update/insert/delete { $gridConn->render_table("markers", "marker_id", "name,address,city,province_id,zipcode,phone"); } ?>[/code](All data from the database is fictive, made-up)
What i’m I doing wrong?