Thank you Geremy, Than you John,
Yes,... I'm a newbie... I straight it up on Video view issue but can't
do it here,... I'll give it a try,...

But I also, forgot to mention, need to have that Guest table updated
to delete old records like 2 weeks ago..., and ALSO once some user is
traveling to other ones Videos, Profile, Blogs,... etc,... this table
NEED TO KEEP ONLY ONE RECORD OF A guest, and not to write every time
is same user accessed other once pages... Video, Profile,... etc...

Please help help with this guys,..

thank You
chris
Salute All !!


On Feb 14, 11:40 pm, Jeremy Burns | Class Outfit
<jeremybu...@classoutfit.com> wrote:
> The first thing you are doing wrong is using Model->query; you might as well 
> skip Cake altogether and write your app in plain old PHP.
>
> You raised a similar query a few days ago, and this warrants the same 
> solution. Here it is again (amended with your new models and fields):
>
> Sounds like you need to have a line of code in the controller's view method 
> that calls a simple model function:
>
> $this->FocikiGuest->recordVisit($id, $user['User']['id'], $this->user['id']);
>
> In the model:
>
> function recordVisit($id, $userId, $guestId) {
>         $this->updateAll(
>                 array(
>                         'FocikiGuest.user_id' => $userId,
>                         'FocikiGuest.guest_id' => $guestId
>                 ),
>                 array('FocikiGuest.id' => $id)
>         );
>
> }
>
> Or you could just call it directly from the view method in the controller:
>
> $this-> FocikiGuest->updateAll(
>         array(
>                 'FocikiGuest.user_id' => $user['User']['id'],
>                 'FocikiGuest.guest_id' => $this->user['id']
>         ),
>         array('FocikiGuest.id' => $id)
> );
>
> This way, whenever the view method is called (in other words, each time the 
> page is rendered) you record the user_id and guest_id.
>
> Jeremy Burns
> Class Outfit
>
> jeremybu...@classoutfit.comhttp://www.classoutfit.com
>
> On 15 Feb 2011, at 06:11, chris...@yahoo.com wrote:
>
>
>
>
>
>
>
> > Hi All,
> > Ok guys, what am I doing wrong...?
>
> > $this->Guest->query('UPDATE fociki_guests' .  'SET user_id =
> > ($user['User']['id'])' . ' AND guest_id = ($this->user['id'])');
>
> > I need to update guest table every time its accessed by users to any
> > User page. First I need to make this code straight it up... Please
> > help. I can't make it work...
>
> > Thanks
> > chris
>
> > --
> > Our newest site for the community: CakePHP Video 
> > Tutorialshttp://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+unsubscr...@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+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php

Reply via email to