I have set up model with gii and I have table call make and it has a few columns, there is one that is called make, how can I get all the data from column make back in the controller.
here is my action
public function actionAutoCompleteMake()
{
$makeModel= Make::model()->load(fieldMake);
}
If you're new to Yii, you should check out the docs for Yii's Active Record.
public function actionAutoCompleteMake()
{
$makeModels = Make::model()->findAll(array("select"=>"fieldMake", "order"=>"fieldMake DESC"));
}
You can do this also with some condition :-
$criteria = new CDbCriteria;
$criteria->select = "fieldMake";
$criteria->condition = " fieldName = fieldValue";
$results = Make::model()->findAll($criteria);
May be It will help you also.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With