I have displayed the relational database data's in drop down that's working properly
But when i try to insert the data's to another form containing relational database tables as drop down It throws error
<select>
<option value=""> Select Category</option>
{% for category in category %}
<option value="{{category.category}}"> {{category.category}} </option>
{% endfor %}
</select>
While inserting the data's the error is
An exception occurred while executing 'INSERT INTO new_product (product_code, product_name, quantity, price, gst, hsn_code, product_metric, product_dimension, supplier_name, category_id) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?)' with params ["RE45", "Shirt", 4, 456.9, 70.8, 2345, 3, 4, "sakthi", null]:
SQLSTATE[23000]: Integrity constraint violation: 1048 Column 'category_id' cannot be null