How to save using PHP connector

Hello,

I’m trying the connector first time and I’m running in problems…
I created a SQL like
SELECT DISTINCT supplier_code,supplier_name,supplier_location,country_abbr,commodity_main,commodity_sub FROM suppliers,countries WHERE countries.id = suppliers.id_countries’;
To render it I used
$conn->render_complex_sql($sql,“suppliers.id”,“supplier_code,supplier_name,supplier_location,country_abbr,commodity_main,commodity_sub”);
And in the JS I wrote
Grid.load(“mysqlconnect.php”);
dpg = new dataProcessor(“mysqlconnect.php”);
dpg.init(Grid);
I also bound a form as shown in your example. This all works well when reading some content from the database.

But how to save something?

On client side, most probably, calling the form.save() will be enough

On server side, you need to replace render_complex_sql, with something like next, as saving works only for render_table based initializations.

$conn->render_table(“suppliers”,“id”,“supplier_code,supplier_name,supplier_location,country_abbr,commodity_main,commodity_sub”);