Catching MySQL index violation errors

TonyMJ

New Member
I have an external database table where new records must be unique on three fields. The simplest way to check this (I thought!) is to set up unique MySQL index on these three fields. However, if I add a (deliberately) duplicate record via my Fabrik form, I get a Javascript alert saying the new record has been saved but of course it isn't. The only indication is that there's no AJAX refresh of the table.

I can probably come up with a way of checking for uniqueness using the validation system, maybe using the 'areuniquevalues' validation plugin, but it would be very helpful to be able to catch the MySQL error and process that. Is this possible? I can't see how to do it.
 
Nope. All kinds of reasons why not. You'll have to use either 'areuniquevalues' or roll your own validation.

-- hugh
 
We are in need of some funding.
More details.

Thank you.

Members online

No members online now.
Back
Top