hey anthony...that was it thx....

your right it is bad form....it was just simple testing first......i
changed tht as well...

thx so much

On 16 Aug., 14:25, Anthony <[email protected]> wrote:
> A function stops executing when return is called.
>
> Your return is before your delete.
>
> Though deleting a record in a function called __getRecord sounds like
> poor form to me.
>
> On Aug 15, 6:14 am, Tomfox Wiranata <[email protected]> wrote:
>
> > hi,
>
> > i am trying to delete a record from a table. to do that i call a
> > different model from my controller. anyway, i can retrieve the correct
> > data perfectly, that tells me the process is right. but i can't delete
> > a specifi record. first i declared the foreign model in my controller
>
> > var $uses = array('User', 'Test');
>
> > now i am retreiving the first record from that table, "tests". it
> > happens in my controller:
>
> >     function __getRecord()
> >     {
> >         $erg = $this->Test->find('first');
> >         $id = $erg['Test']['id'];
>
> >                 $this->set('proxies', $erg);
> >                                       return $erg['Test']['name'];
> >                 $this->Test->delete($id);
> >     }
>
> > After i got it i want to delete it from the table so i am passing the
> > $id to the delete function. but cake just wont delete the record.
>
> > i checked. the correct id is passed...
>
> > i am calling this function like
> > $this->Session->write('abc.test', $this->__getRecord());
>
> > can u see the problem? looking forward to your help :)
> > THX

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