I am using cakephp with php, I have table with field id having data type auto number.
In my form I do not have any field with id that’s why it sets blank in my model and when I tries to save data it gives error.
how can I insert data into selected columns using model in cakephp?
When you pull the form data, make sure you are using an array with the model name and field names. For example, if you are saving a book to the book model, the array would look something like:
Then when you save the data, you must call create, then save:
This will automatically add the ID (whether auto-increment or UUID) and save the new record.