Also spotted this method today: http://cakeexplorer.wordpress.com/2007/08/23/cakephp-12-custom-validation-unique-behavior/
On Aug 23, 9:58 am, RichardAtHome <[EMAIL PROTECTED]> wrote: > http://bakery.cakephp.org/articles/view/checking-for-duplicate-record... > > On Aug 23, 9:39 am, Deniz Chaban <[EMAIL PROTECTED]> wrote: > > > Hi. I have a UNIQUE contraint on one of my fields in my database > > table. > > > When using save() sometimes this constraint gets violated. MySQL then > > returns an exception. How do I catch this exception so that I can show > > the user a good error message? > > > I do not want to make a select query to see if that value is not > > already in use before calling to save. > > > I can't find any information about this anywhere. Maybe this is just > > impossible with PHP. I'm using cake 1.2 and PHP > 4.3. > > > Thanks, > > Deniz --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Cake PHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~----------~----~----~----~------~----~------~--~---