http://bakery.cakephp.org/articles/view/checking-for-duplicate-records-unique-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 [email protected] 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 -~----------~----~----~----~------~----~------~--~---
