Ok I will try this in the mean while but what I am doing is setting cookies so that it recognises that specific users details when they add info to the database so they enter their email among other things so thats why im using email to check for their details so that if they already exist then i add a new post for the same user and not add onther user with the same info but different id
On Tue, Jan 11, 2011 at 11:34 AM, Stephen <step...@ninjacodermonkey.co.uk>wrote: > Try using: > > $user = $this->User->find('first', array('conditions' => array('User.email' > => $email_address))); > > Although in most applications it's usually best to get the current user's > id from the auth component session data. > i.e. $this->Auth->user('id'); > > Unless ofcourse you're doing something a little bit different > > Hth > > On 11 January 2011 09:03, Spha ps <pss...@gmail.com> wrote: > >> Hi all, >> >> I was wonder how would i go about check the users table to see if an email >> exists if it does get that id to add a new post for that user ? >> >> thanks in advance >> Spha >> >> 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<cake-php%2bunsubscr...@googlegroups.com>For >> more options, visit this group at >> http://groups.google.com/group/cake-php?hl=en >> > > > > -- > Kind Regards > Stephen @ NinjaCoderMonkey > > www.ninjacodermonkey.co.uk > > > 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<cake-php%2bunsubscr...@googlegroups.com>For > more options, visit this group at > http://groups.google.com/group/cake-php?hl=en > 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