There might be some helpful suggestions here
http://groups.google.com/group/cake-php/search?group=cake-php&q=db+error&qt_g=Search+this+group
On Feb 13, 2008 2:14 PM, angusm <[EMAIL PROTECTED]> wrote:
>
> Hi All
>
> How can I get the error details of a failed save call into a local
> variable? Here is basically what I'm trying to do in controller, what
> can I use for <variable with error details> so I can send the error
> details back to client?
>
> function save()
> {
> $this->layout = 'json';
> $aResult = array();
> if ($this->Bond->save($this->data)) {
> $aResult['success'] = true;
> $aResult['data'] = array('Bond application succesfully
> saved...');
> } else {
> $aResult['success'] = false;
> $aResult['data'] = array(<variable with error details>);
> }
> $this->set('sResult', $this->json->encode($aResult));
> $this->render('json/response');
> }
>
> Any help appreciated!
>
> Cheers
>
> >
>
--
--
(the old fart) the advice is free, the lack of crankiness will cost you
- its a fine line between a real question and an idiot
http://blog.samdevore.com/archives/2007/03/05/when-open-source-bugs-me/
http://blog.samdevore.com/cakephp-pages/my-cake-wont-bake/
http://blog.samdevore.com/cakephp-pages/i-cant-bake/
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---