F
Filament16mo ago
ghc

Filament SQLSTATE[23000]: Integrity constraint violation: 1062 Duplicate entry

"I already have one record in the database, but when I try to add another record, it throws an error. Please refer to the attached image. Should I use 'try-catch' to resolve this, or are there other methods?"
2 Replies
ghc
ghcOP16mo ago
this is my code
Jyrki
Jyrki16mo ago
Check your database structure, it seems that the semester + student id columns combination have to be unique in your reservations table. If this needs to be the case you should add validation accordingly or remove the unique constraint on your key
Want results from more Discord servers?
Add your server