pestaa
(Pestaa)
1
$user=Account::model()->findByAttributes(array('name'=>$username));
generates
SELECT * FROM `Account` WHERE `Account`.`name`=:yp0 LIMIT 1
I confirmed the existense of $username. It seems impossible to debug without touching CActiveRecord.
Any suggestions, please?
Ticket created.
qiang
(Qiang Xue)
2
In your db connection config, you can set ‘enableParamLogging’=>true to turn on parameter logging.
pestaa
(Pestaa)
3
2009/08/14 20:59:04 [trace] [system.db.CDbCommand] Querying SQL: SELECT * FROM `Account` WHERE `Account`.`name`=:yp0 LIMIT 1. Bind with parameter :yp0='pestaa'
Edit:
Please forgive my stupidity, I was in the misbelief that the generated SQL that was sent to firebug was also sent to the database.
I see my mistake now. Sorry for any inconvenience.
$model=OasisRiskAssessment::model()->findByAttributes(array(‘patient_id’=>$_REQUEST[‘id’]));
is i get model with patient_id equal to $_REQUEST[‘id’]
perochak
(Amjad Mughal)
5
Yep,
You can also use FindByPK if id is your primary key