Insert Record to database - no default value for Id

Hello. I was trying to upload some records to my database but i was returned this error

Fatal error : require(): Failed opening required ‘…/…/…/dmxConnectLib/dmxConnect.php’ (include_path=’.:’) in /membri/vmpl1/dmxConnect/api/admin/insertcontrols.php on line 2.

How can i solve this error?

Seems that not all files are uploaded, upload the dmxConnectLib to your server.

1 Like

Thanks for your help. That error is now solved but another one popped up.

{“code”:“HY000”,“file”:"/membri/vmpl1/dmxConnectLib/lib/db/Connection.php",“line”:108,“message”:“SQLSTATE[HY000]: General error: 1364 Field ‘idTranceria_ACC’ doesn’t have a default value”,“trace”:"#0 /membri/vmpl1/dmxConnectLib/lib/db/Connection.php(108): PDOStatement->execute()\n#1 /membri/vmpl1/dmxConnectLib/modules/dbupdater.php(38): lib\db\Connection->execute(‘INSERT INTO `Tr…’, Array, false, ‘Tranceria_ACC’)\n#2 /membri/vmpl1/dmxConnectLib/lib/App.php(159): modules\dbupdater->insert(Object(stdClass), ‘insertcontrols’)\n#3 /membri/vmpl1/dmxConnectLib/lib/App.php(128): lib\App->execSteps(Object(stdClass))\n#4 /membri/vmpl1/dmxConnectLib/lib/App.php(98): lib\App->execSteps(Array)\n#5 /membri/vmpl1/dmxConnectLib/lib/App.php(71): lib\App->exec(Object(stdClass))\n#6 /membri/vmpl1/dmxConnect/api/admin/insertcontrols.php(208): lib\App->define(’{\n “meta”: {\n …’)\n#7 {main}"}

Any ideas?

This means that your database field ‘idTranceria_ACC’ is required but you haven’t included it in your Insert Record action. The field has no default value as well - so that is why you can’t omit it.

‘idTranceria_ACC’ is my primary key, it’s auto incremental; i have included it in the insert action but not in the form as i don’t want people to write in that space

It should not be included in the insert action, as it’s a primary key and auto incremental. You should leave your database to manage it.

i’m sorry, i was looking at the wrong server action. I haven’t included it in the insert action

Then are you sure it’s properly setup as a primary key and to auto increment? Please double check your db table configuration.

Can you check if your mysql server probably has the strict mode setting enabled, as explained in this topic:

1 Like

That was it. The free server i was using had this mode enabled.
Now i have another problem :slight_smile:
I was trying to make a database insert action and i wanted to see my table made of 23 input fields and i was trying to figure out why wappler didn’t show them while i was able to see them on phpmyadmin.So I fount out that if I eliminate 13 input fields I can see the remaining fields . How can I add the rest on wappler?

Hello,
I am not sure i understand where you did not see them exactly? Can you post a screenshot of where you are looking for your fields and they are missing?

6 posts were split to a new topic: Not all database fields are listed