Thursday, April 21, 2011

Re: UPDATE table

thank you Mike,...
I got a different approach...

$this->Session->write('guest', array('guest_id' => $this->user['id'],
'user_id' => $user['User']['id']));

it's working like a Clock... :)
thank You All !

On Apr 21, 3:48 am, mi...@brightstorm.co.uk wrote:
> > I think you are missing some apostrophes and full stops...
>
> > $this->User->query('UPDATE fociki_quests SET guest_id = ' .
> > $this->user['id'] . ' WHERE id = ' . $user['User']['id']);
>
> > I'd stick the SQL into a variable first and debug it to screen to check
> > its syntax.
>
> or use a cake syntax
>
> $this->User->FokitiGuest->id= $user['User']['id'];
> $result = $this->User->FokitiGuest->saveField('guest_id',$this->user['id']);
>
> which is far cleaner.
>
> HTH
> mikek
>
>
>
>
>
>
>
>
>
> > Jeremy Burns
> > Class Outfit
>
> > jeremybu...@classoutfit.com
> >http://www.classoutfit.com
>
> > On 21 Apr 2011, at 10:52, chris...@yahoo.com wrote:
>
> >> $this->User->query('UPDATE fociki_quests SET guest_id = ' $this-
> >>> user['id'] WHERE id = ' . $user['User']['id']);
>
> > --
> > Our newest site for the community: CakePHP Video Tutorials
> >http://tv.cakephp.org
> > Check out the new CakePHP Questions sitehttp://ask.cakephp.organd help
> > others with their CakePHP related questions.
>
> > To unsubscribe from this group, send email to
> > cake-php+unsubscribe@googlegroups.com For more options, visit this group
> > athttp://groups.google.com/group/cake-php

--
Our newest site for the community: CakePHP Video Tutorials http://tv.cakephp.org
Check out the new CakePHP Questions site http://ask.cakephp.org and help others with their CakePHP related questions.


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

No comments: