You should call lastError() on model datasource: $this->getDataSource
()->lastError(), same for other DboMysql methods.

On Sep 15, 6:39 pm, senser <[email protected]> wrote:
> Hello,
>
> I'm trying to find a way to get errors occurred when executing SQL
> queries for adding, editing or deleting rows and show them in view.
> There is a method in DboMysql called lastError() but when calling it I
> receive an error: "Undefined property: ***::$connection". There is a
> callback method onError() in model too, but I can't find how to use it
> to receive sql error.
> For example: User want to save new row in database table. Row data
> passes validation rules but when Cake tries to save it to mysql,
> server returns an error for duplicate entry in some row field - I need
> to show that error to user.
>
> Thanks!
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"CakePHP" 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
-~----------~----~----~----~------~----~------~--~---

Reply via email to