huh, that makes sense :)

this is the array

Array (
 [0] => Array ( [LinkTmp] => Array ( [id] => 695 [link_id] => 0 [eyed]
=> 111 [title] => [name] => Gehalt.xslsx [path] => ../link/111/
Gehalt.xlsx [filetype] => xlsx [size] => 22528 [flyer_big] =>
[flyer_thumb] => [qr] => [attachment] => 1 [created] => 2010-09-15
19:44:53 ) )

 [1] => Array ( [LinkTmp] => Array ( [id] => 699 [link_id] => 0 [eyed]
=> 111 [title] => [name] => Meeting 18082010.ppt [path] => ../link/111/
WITA Meeting 18082010.ppt [filetype] => ppt [size] => 152576
[flyer_big] => [flyer_thumb] => [qr] => [attachment] => 1 [created] =>
2010-09-15 19:47:38 ) ) )
x :)
any suggestions how to code related to this structure?

th

On 15 Sep., 19:13, "j.blotus" <j.blo...@gmail.com> wrote:
> When you do find 'all', it returns the array in a numeric index, when
> you do find 'first' it returns a single item with no numeric index.
> When you omit parameters, I believe it defaults to 'first'.
>
> So the answer is you need to look at how the array you are trying to
> work with is formatted.
>
> print_r($tmp_attachment);
>
> Missing index is the most basic of errors, it just tells you the index
> you are looking for doesn't exist.
>
> On Sep 15, 12:55 pm, Tomfox Wiranata <tomfox.wiran...@gmail.com>
> wrote:
>
> > as soon as I abandon the 'all' paramter in my find() function, cake
> > stops throwing this error.
>
> > but i need 'all' because i am expecting multiple entries
>
> > On 15 Sep., 18:50, Tomfox Wiranata <tomfox.wiran...@gmail.com> wrote:
>
> > > hi.
>
> > > I have two Models LinkTmp and LinkAttachment, hence two tables. these
> > > two models have no relation at all, since the LinkTmp is just for
> > > temporary storing, till the User finally saves his product.
>
> > > I want to save data from LinkTmp in LinkAttachment. Its nothing else
> > > than copying the data from the temp table to the real target. So first
> > > i get all the data from LinkTmp I need:
>
> > > $tmp_attachment = $this->LinkTmp->find('all', array('LinkTmp.abc =' =>
> > > $this -> Session -> read('Link.abc'), 'LinkTmp.attachment' => '1'));
>
> > > the result is multiple results. I checked. now i need to save these
> > > results in LinkAttachment:
>
> > >  $this->data['LinkAttachment']['filesize'] = $tmp_attachment['LinkTmp']
> > > ['size'];
> > >  $this->data['LinkAttachment']['filetype'] = $tmp_attachment['LinkTmp']
> > > ['filetype'];
> > >  $this->LinkAttachment->saveAll($this->data);
>
> > > now cake throws
>
> > > Notice (8): Undefined index: LinkTmp
>
> > > how is that possible? I used this model before in my view the same
> > > way, just with pure find() and no 'all'...
>
> > > thanks !!

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