table-key-field-not-being-included-in-insert

Questionstable-key-field-not-being-included-in-insert
Adrian BRadshaw asked 18 hours ago

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
Abu answered 12 hours ago

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

Adrian Bradshaw answered 4 hours ago

Abu That\’s great. It works nicely. I don\’t know where I\’d be without gridphp. I tried so many others before I settled on this (and bought a licence). A

Your Answer

14 + 8 =

Login with your Social Id:

OR, enter

Attach code here and paste link in question.
Attach screenshot here and paste link in question.



How useful was this discussion?

Click on a star to rate it!

Average rating 0 / 5. Vote count: 0

No votes so far! Be the first to rate it.

We are sorry that this post was not useful for you!

Let us improve this post!

Tell us how we can improve this post?