MySQL: Is there any possible way to get notified about thesql-server FOREIGN KEY CONSTRAINT violation during INSERT, if FOREIGN_KEY_CHECKS=0

MySQL

Plese don't bite me, i'm a newbie here …
So here is the question:

Is there any possible way to get notified about mysql-server FOREIGN KEY CONSTRAINT violation during INSERT, if FOREIGN_KEY_CHECKS=0 ? Is it possible to recive this info at my php code? Something like mysql warnig ? Any info would be useful.

Thank you

Best Answer

Check out here - the point about using this system (or session) variable is to load tables in an order which is " different from that required by their parent/child relationships". You switch it off for that reason - if you want warnings of breaches of RI (Referential Integrity), then set it to 1 and you will get warnings. It can be set on the session level.