After click on save button on the form, on nuDebug Results appears message: SQLSTATE[23000]: Integrity constraint violation . . .
It is correct and expected, but I would like to show some popup message to user, to warn him about his mistake. Is there some elegant way to do that, because I cann't find any event which I can use.
Welcome to the nuBuilder Forums!
Register and log in to access exclusive forums and content available only to registered users.
Register and log in to access exclusive forums and content available only to registered users.
User warning message, when Integrity constraint violated
-
- Posts: 25
- Joined: Sat May 08, 2021 1:20 pm
-
- nuBuilder Team
- Posts: 4305
- Joined: Sun Oct 14, 2018 6:43 pm
- Has thanked: 71 times
- Been thanked: 445 times
- Contact:
Re: User warning message, when Integrity constraint violated
Remove the constraints, they do not work with nuBuilder.
-
- Posts: 25
- Joined: Sat May 08, 2021 1:20 pm
Re: User warning message, when Integrity constraint violated
I guess, mysql database error is not the source of any nuBuilder form event? Except it appears in zzzzsys_debug table.
-
- nuBuilder Team
- Posts: 4305
- Joined: Sun Oct 14, 2018 6:43 pm
- Has thanked: 71 times
- Been thanked: 445 times
- Contact:
Re: User warning message, when Integrity constraint violated
If there are any constraints on the table, please remove them or you will keep getting these Integrity constraint violations.
-
- Posts: 25
- Joined: Sat May 08, 2021 1:20 pm
Re: User warning message, when Integrity constraint violated
I could do my best to delete the resulting messages in zzzzsys_debug table, but it would be in vain, if there are other, perhaps more important reasons why there should be no constraints in the database.
-
- nuBuilder Team
- Posts: 4305
- Joined: Sun Oct 14, 2018 6:43 pm
- Has thanked: 71 times
- Been thanked: 445 times
- Contact:
Re: User warning message, when Integrity constraint violated
My question is if these constraints are required or if you could simply get rid of them.
-
- Posts: 25
- Joined: Sat May 08, 2021 1:20 pm
Re: User warning message, when Integrity constraint violated
In this particular case, disabling the database constraints requires writing additional php code for validation in BS. In general, the use of database constraints is often the most elegant and secure way to control data entry. For that reason, it seems a great sacrifice not to use it.