Re: Small problem passing variables

2009-01-08 Thread Webweave
If you want to pull the value from the session, I would do that in the controller, and set the value there. You don't need any code to read the session in the view. In your controller, just set the field 'user_id' to the value you got from the session (if I'm understanding the point of the code

Re: Small problem passing variables

2009-01-07 Thread Steppio
Hello again everybody This systems been working fine but for one problem, i keep getting this error message when passing the ID across controller/views: SQL Error: 1366: Incorrect integer value: '' for column 'user_id' at row The site takes the users username and password, then goes onto a diffe

Re: Small problem passing variables

2009-01-02 Thread Webweave
It shouldn't as you are writing to the session, which is not shared across sessions ... On Dec 30 2008, 6:40 am, Steppio wrote: > Ahh thank you very much, i understand now. I've used the following in > the controller to set the id in the session: > >                                 $user_id = $t

Re: Small problem passing variables

2008-12-30 Thread Steppio
Ahh thank you very much, i understand now. I've used the following in the controller to set the id in the session: $user_id = $this->User->getLastInsertId(); $this->Session->write('User.id', $user_id); And then i used the session he

Re: Small problem passing variables

2008-12-30 Thread Steppio
Ahh thank you very much, i understand now. I've used the following in the controller to set the id in the session: $user_id = $this->User->getLastInsertId(); $this->Session->write('User.id', $user_id); And then i used the session he

Re: Small problem passing variables

2008-12-30 Thread Steppio
Thanks to everyone for the responses its been a big help, i am still stumped however, are getInsertID and getLastInsertID model functions? If so how would i pass these to the views? On Dec 29, 4:22 pm, Webweave wrote: > I think you meant $this->User->getLastInsertId(); > > On Dec 28, 9:59 am, Tr

Re: Small problem passing variables

2008-12-30 Thread majna
http://api.cakephp.org/class_model.html#2525df39f43db3a76bff482265695d54 getLastInsertID is wrapper for getInsertID, so getInsertID is a it faster. in controller: $this->set('user_id', $this->User->getInsertID()); On Dec 30, 2:50 pm, Steppio wrote: > Thanks to everyone for the responses its bee

Re: Small problem passing variables

2008-12-30 Thread Bernardo Vieira
getLastInsertID() and getInsertID() are both equivalent model functions (please note the capitalized d in both of them). You can pass this to the view using set() in the controller as you would pass any other variable, however it doesn't feel quite right to do this. What I would do in your posi

Re: Small problem passing variables

2008-12-30 Thread Steppio
Thanks to everyone for the responses its been a big help, i am still stumped however, are getInsertID and getLastInsertID model functions? If so how would i pass these to the views? On Dec 29, 4:22 pm, Webweave wrote: > I think you meant $this->User->getLastInsertId(); > > On Dec 28, 9:59 am, Tr

Re: Small problem passing variables

2008-12-30 Thread Steppio
Thanks to everyone for the responses its been a big help, i am still stumped however, are getInsertID and getLastInsertID model functions? If so how would i pass these to the views? On Dec 29, 4:22 pm, Webweave wrote: > I think you meant $this->User->getLastInsertId(); > > On Dec 28, 9:59 am, Tr

Re: Small problem passing variables

2008-12-29 Thread Webweave
I think you meant $this->User->getLastInsertId(); On Dec 28, 9:59 am, Troy Schmidt wrote: > $this->User->getInsertID(); > > I don't know about the Auth component as i haven't used it alot.  But > that would get the last inserted ID.  I would just set that variable > and include it in the view fo

Re: Small problem passing variables

2008-12-28 Thread Troy Schmidt
$this->User->getInsertID(); I don't know about the Auth component as i haven't used it alot. But that would get the last inserted ID. I would just set that variable and include it in the view for the future steps. Otherwise it looks like 'user_id' isn't set yet for user On Dec 28, 11:11 am, S

Small problem passing variables

2008-12-28 Thread Steppio
Hello everybody, i am totally new to Cake and am finding it quite difficult to understand all the different parts of it. At the moment i'm trying to make a three part user registration process, firstly with the username and password fields, then onto details about the user, then on to duties they