Monday, March 2, 2009

customizing foreign key constraint error

Hi friends,

I am using innodb database and following error occurs when there is
dependency between tables.

Warning (512): SQL Error: 1451: Cannot delete or update a parent row:
a foreign key constraint fails (`youdecor8/users`, CONSTRAINT
`styles_users` FOREIGN KEY (`style_id`) REFERENCES `styles` (`id`) ON
UPDATE NO ACTION) [CORE\cake\libs\model\datasources\dbo_source.php,
line 514]

Does anyone know how to customize this error message in user friendly
way? I actually need to inform user that record can not be deleted
because he violated foreign key rules.

Any help is deeply appreciated in advance.

Krishan

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to cake-php+unsubscribe@googlegroups.com
For more options, visit this group at http://groups.google.com/group/cake-php?hl=en
-~----------~----~----~----~------~----~------~--~---

No comments: