How to troubleshoot Master Detail View

jpmoran

New member
PHP Version: 7.4.2

mysql version: 5.7.26

Web server: Apache/2.2.34 (Unix) mod_wsgi/3.5 Python/2.7.13 PHP/7.4.2 mod_ssl/2.2.34 OpenSSL/1.0.2o DAV/2 mod_fastcgi/mod_fastcgi-SNAP-0910052141 mod_perl/2.0.11 Perl/v5.24.0

Client: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/84.0.4147.125 Safari/537.36

I have an app that some of my master details pages are not allowing for new records to be created.

For example, I have a customer invoice table that links to notes and items stored in their own tables. I can add notes from the master detail view without a problem, but when I try to add an item I get the following error.

[08] Error: during query execution. INSERT INTO `SponsorshipItems` (`Content_ContentID`, `ItemPoints`, `ItemQuantity`, `CreationDate`, `EditDate`) VALUES ('3', '1', '1', '2020-08-20 14:10:34', '2020-08-20 14:10:34')
The DBMS server said: SQLSTATE[HY000]: General error: 1364 Field 'Sponsorships_SponsorshipID' doesn't have a default value

Any thoughts on how to best troubleshoot this error?
 

Martin68

Well-known member
jpmoran Wrote:
-------------------------------------------------------

> [08] Error: during query execution. INSERT INTO `S
> ponsorshipItems` (`Content_ContentID`, `ItemPoints
> `, `ItemQuantity`, `CreationDate`, `EditDate`) VAL
> UES ('3', '1', '1', '2020-08-20 14:10:34', '2020-0
> 8-20 14:10:34')
> The DBMS server said: SQLSTATE[HY000]: General err
> or: 1364 Field 'Sponsorships_SponsorshipID' doesn'
> t have a default value

Think the field is the primary key of your table - have you set it as Auto increment field?

Martin
 
Top