On Mar 2, 11:25 pm, mscdex <msc...@gmail.com> wrote:

> I usually do this sort of checking in the model validation or in the
> delete controller action before the deletion is attempted. Something
> like a find('count') or similar method to to check if the ID of the
> record to be deleted exists in a FK in some other table or record. You
> might also try the model's 'del' method which has a 'cascade' option
> (http://book.cakephp.org/view/690/del).

Thanks for replying and suggested. Actually I am executing just delete
command of the model. If user is trying to delete a category which Id
exists in other table as foreign key then mysql throws the error which
I posted in my previous message. This error message does not look good
and user friendly as well. I need to catch this mysql error in advance
and show a user friendly message for same action. Do anyone have any
idea to do this?

--~--~---------~--~----~------------~-------~--~----~
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+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to