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 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

-- 
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

Reply via email to