find function doesn't work on component. Say if i execute the following sentence $this -> Account -> find( 'all' );
cakephp execute select from accounts( there is not * ). As long as I get the sql working i don't mind not using the find On Mar 7, 3:49 am, "Krissy Masters" <[email protected]> wrote: > Whats wrong with a cake find()? > > If data is coming from a form it would be in $this->data.... > > Have you read or looked at the cookbook? > > $account = $this->Account->find('first', array('conditions' => > array('Account.username' => $emailAddress))); > > -----Original Message----- > From: [email protected] [mailto:[email protected]] On Behalf > > Of cake-learner > Sent: Monday, March 07, 2011 7:34 AM > To: CakePHP > Subject: cakephp model problem > > Still continue having problem with cakephp model. > > I always have the account empty and don't know why. > > Configure::write( "debug", 2 ); > $emailAddress = $_POST[ 'email_address' ]; > $sql = "SELECT * FROM accounts WHERE username = '" . $emailAddress . > "' LIMIT 1"; > echo $sql; > $account = $this -> Account -> Query( $sql ); > var_dump( $account ); > > The following is the sql executed and works ( can get the result ) > when try to execute this sql sentence on phpmyadmin. > SELECT * FROM accounts WHERE username = '[email protected]' LIMIT 1 > > -- > 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 > [email protected] 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 [email protected] For more options, visit this group at http://groups.google.com/group/cake-php
