Thursday, October 28, 2010

Re: How to insert an empty string with CakePHP

sorry, not sure I follow. How?
Because if the field is blank, Cake does not insert NULL, it just
ignore the field.
I would have to explicitly write
If ($data['Taxcode']['description']=='') $data['Taxcode']
['description'] = null;
before calling the save method.
I know I can use beforeSave and other workarounds, but I just wanted
to make sure I was not doing something wrong :P

On Oct 29, 10:36 am, cricket <zijn.digi...@gmail.com> wrote:
> On Thu, Oct 28, 2010 at 7:50 PM, Caroline <cdotc...@gmail.com> wrote:
> > sorry I meant every time I need to update, like if description is
> > blank then insert null.
>
> Well, there you go--Cake does that for you ;-)

Check out the new CakePHP Questions site http://cakeqs.org and help others with their CakePHP related questions.

You received this message because you are subscribed to the Google Groups "CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to
cake-php+unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en

0 Comments:

Post a Comment

Subscribe to Post Comments [Atom]

<< Home


Real Estate