Insert Error with Primary Keys

I have a form linked with my database, but for some reason when I input the form it won’t submit and shows up with an error. I have the PK of Company_ID set to auto_increment in MySQL and increment in Wappler, but for some reason it doesn’t submit with my form. I’ve tried adding it in my create API and have been troubleshooting all day, but I can’t get an insert from my desktop to my database, only inserts from my database go to wappler. I also have the Update working perfectly fine, so I’m really scratching my head. If someone could please help me and soon I’d appreciate it a ton.


some common mistakes already addressed: My submit button is linked so when it clicks the form is submitted, I also have it linked with my createcompany API and am using data detail.


image

any help would be so appreciated, spent the better part of 4 hours on this one issue.

Here’s the SQL code: image

Check the “response” also in the devtools of your “create” action it seems an error occurred

See also:

Thank you! It now tells me the issue in Wappler. It’s weird, the issue was that I wasn’t inputting a value that’s set as NULL in my DB and on Wappler yet it won’t submit until I put the value in.

Well if your database requires some values, then you should add also validation to your form so that user is alerted on missing values.

I’ve done that for the values that I want to be NOT NULL but it’s saying the values that are set to NULL need to be inputted.

Hi Parker,

There are 2 places where input validations can take place. If no Required validation has been setup on the client side for the input field that is set to NULL in the database table, then check the linked $_POST field, it may have setup with Required validation in the API.