How to add integrity constraint check on all controllers while inserting values to db in YII? what is the simplest method for it?
if($model->save())
$this->redirect(array('view','id'=>$model->id));
Exception appear here
CDbCommand failed to execute the SQL statement: SQLSTATE[23000]: Integrity constraint violation: 1062 Duplicate entry '9-5' for key 'xyz'. The SQL statement executed was: INSERT INTO `tbl_table` (`xyz`, `x`, `x`, `x`, `x`, `x`, `x`, `created`) VALUES (:yp0, :yp1, :yp2, :yp3, :yp4, :yp5, :yp6, NOW())