On 7/1/07, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote:
>
>
> I use typical function:


[..snip..]

>
> Interesting: one host, 4 copy of code (different folders, DB). But in
> one copy does'nt work validation.
> When I type: /posts/add I see message: "Post was added" and get empty
> record in table.
> In model post.php, of couse, I wrote: body, title VALID_NOT_EMPTY.
> Very strange: 3 copy worked normal. One - have problem. Why - I don't
> understand ;-(
>
> I add if ($ this->params['data']['Post']['body'] != '')... And code
> work properly.
>
> But why? I don't understand ;-(


[..snip..]

Hi,

Have you tried enabling SQL debug to see what INSERT statement it is using?

Some comments about your code:

- $this->render() executes by default (if autoRender is set to true) so you
can probably just do if ($this->data) to check if there's anything
submitted. If not, it will render() by default (right now you're doing if
(empty($this->params['data'])) { ... } else { ... }.

-  You don't need to do: $this->set( 'data', $this->data ) ... $this->data
is available from the view automatically.

Hope this helps.

- Gonzalo

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