Explain $Record=Users::model()->Findbyattributes(Array('email' => Yii::app()->Request->Getpost('email')));

$record=Users::model()->findByAttributes(array(‘email’ => Yii::app()->request->getPost(‘email’)));

can anyone explain this code pls

Man, srsly, read the docs.

if anyone can help me it is realy appreciate.

I need to put this code in yii way

help me

mysql_query(SELECT email FROM user WHERE email = "$email");

What do you want to know?

You search for a set of entries that has the same E-Mail-value like in the post, or not?

It should be the same like your mysql_query.

But is it correct, that your model-class has the name "Users"? Your table has the name user.

Be cool, So easy:




$cre = new CDbCriteria();

$cer->select='email';

$cer->addSearchCondition('email',$email);

$model=Users::model()->findAll($cer);