SyntaxFix
Write A Post
Hire A Developer
Questions
PDOStatement->execute() can throw an exception
so what you can do is
try { PDOStatement->execute(); //record inserted } catch(Exception $e) { //Some error occured. (i.e. violation of constraints) }