I have a Grid which works fine on existing records, but it won\’t insert a new record because the SQL INSERTÂ doesn\’t include my key field – the first field in the grid – which is unique. What am I missing?
2 Answers
Hi,
By default, grid assume that the table has auto increment primary key, so it skips it while we insert.
If you are entering it by self, you can disable default behavior by setting:
$opt[“autoid”]=false;
This is one of the setting passed to set_options function.
Reference code:
https://www.gridphp.com/demo/demos/promo/customers.phps
Your Answer

