i did what u've just suggested.thanks anyway. and now i know what
caused my problem.
its my autoincrement field. i dunno why the autoincrement didnt
work.wereas i already set the field's type into serial (postgre's
autoincrement's data type).
since the autoincrement didnt work, the primary left to blank. so thats
why the data can not be saved.




On Jan 25, 12:53 pm, "Grant Cox" <[EMAIL PROTECTED]> wrote:
> Well, you have to handle if the model doesn't save - for example if it
> does not pass validation.  The usual method for saving like this is:
>
> if($this->Worker->save($this->data)) {
>         $this->Session->setFlash('The Worker has been saved');
>         $this->redirect('/workers/index');} else {        // could not save 
> for some reason
>         $this->log( $this->Worker->validationErrors );
>         $this->Session->setFlash('Please correct errors below.');
>         $this->render();
>
> }ignoring the difference of using setFlash and redirect vs just flash().
>  The log of the validationErrors will show you which fields are failing
> validation.


--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---

Reply via email to