sorry I meant every time I need to update, like if description is
blank then insert null.

On Oct 29, 9:42 am, Caroline <cdotc...@gmail.com> wrote:
> Ok, fair enough, wrong example. Thanks for the tip, though.
> In my previous post, please replace the code by this (same outputs):
>
>                 $object = array();
>                 $object['Taxcode']['id'] = '63ae4d63efeecf1655e9b948fdc114a8';
>                 $object['Taxcode']['description'] = '';
>
>                 $this->Taxcode->save($object);
>
>                 $data = 
> $this->Taxcode->findById('63ae4d63efeecf1655e9b948fdc114a8');
>
>                 pr($data);
>
> I don't really want NULL in my description because it means I need to
> test for null every time I display the data.
> Thanks for your time.
>
> On Oct 29, 9:31 am, cricket <zijn.digi...@gmail.com> wrote:> On Thu, Oct 28, 
> 2010 at 5:38 PM, Caroline <cdotc...@gmail.com> wrote:
> > > This is the code I run:
> > >                $object = array();
> > >                $object['Taxcode']['id'] = 
> > > '63ae4d63efeecf1655e9b948fdc114a8';
> > >                $object['Taxcode']['acctaxcollected_id'] = '';
> > >                $object['Taxcode']['acctaxpaid_id'] = '';
> > >                $this->Taxcode->save($object);
>
> > This is really bad practice, IMO. It appears that you're trying to set
> > a couple of foreign keys to the empty string. Either allow NULL on
> > those columns or change your business logic, perhaps saving this data
> > using an interim model.

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+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en

Reply via email to