Skip to content
Advertisement

Not able to do Insert operation in CRUD

I am making a CRUD of colors with color_name and color_description. While trying to insert the details the error below has be shown:

JavaScript

below is the insert and show function that I have tried out

JavaScript

model

JavaScript

HTML of insert_color

JavaScript

HTML of show color

JavaScript

I have checked the names assigned and they are matching, so where am I going wrong?

Advertisement

Answer

according to your model, the color_name is a foreign key but somehow your request seems to be sending a string instead of int, which is causing a mismatch there.

User contributions licensed under: CC BY-SA
6 People found this is helpful
Advertisement