i got a table that create from yii framework.

but i face a trouble that how do i retrieve the specific same data from database?


no id gender

1 1010 female

2 1111 male

3 1234 female

4 1221 female

how to do retrieve the data like this

no id gender

1 1010 female

2 1234 female

3 1221 female

I dont really understand what is Your problem here ? Please decribed it one more time … Do You need to make query to select only female from db or maybe something else ?

ya…i just want select all from who is female.

I think that You should go back to Yii documantation. You have really big gap of Yii knowledge, so firstly You should read but not only Active Record from there.

let say this is mysql form

SELECT ‘gender’

FROM worker

WHERE gender = ‘female’

i changed it in the yii form

$gen= Yii::app()->db->createCommand()







i put this in my controller,still failed to show those workers which are female.i admit i still have large gap with the yii framework.

try this

i change it but still unable to solve the problem.But suppose can.

query looks fine, maybe i miss something, please show your view file where you want to display result of this query