Hello
First i asked sorry for my english.
I have created multiple search in my form but i am not able get correct result
my module
public function getAll($id,$name,$country)
{
$criteria=new CDbCriteria;
$criteria->with=array('Country','State');
$criteria->together=true;
$criteria->compare('t.user_id',$id,true,'OR');
$criteria->compare('t.user_nmae',$name,true,'OR');
$criteria->compare('country.id',$country,true,'OR');
return new CActiveDataProvider($this, array(
'criteria'=>$criteria,
));
}
my controler
public function actionAdminaction(){
$model=new TblUser;
if(isset($_POST['userid'])){
$id=$_POST['userid'];
}
if(isset($_POST['username'])){
$name=$_POST['username'];
}
if(isset($_POST['country'])){
$country=$_POST['country'];
}
$dataProvider=$model->getAll($id,$name,$country);
var_dump($dataProvider);
}
whenever print my data stored array i got below like this
object(CActiveDataProvider)[42]
public ‘modelClass’ => string ‘TblUser’ (length=7)
public ‘model’ =>
object(TblUser)[23]
private '_md' (CActiveRecord) =>
object(CActiveRecordMetaData)[25]
public 'tableSchema' =>
object(CMysqlTableSchema)[29]
...
public 'columns' =>
array
...
public 'relations' =>
array
...
public 'attributeDefaults' =>
array
...
private '_model' =>
object(TblUser)[24]
...
private '_new' (CActiveRecord) => boolean true
private '_attributes' (CActiveRecord) =>
array
empty
private '_related' (CActiveRecord) =>
array
empty
private '_c' (CActiveRecord) => null
private '_pk' (CActiveRecord) => null
private '_alias' (CActiveRecord) => string 't' (length=1)
private '_errors' (CModel) =>
array
empty
private '_validators' (CModel) => null
private '_scenario' (CModel) => string 'insert' (length=6)
private '_e' (CComponent) => null
private '_m' (CComponent) => null
public ‘keyAttribute’ => null
private ‘_criteria’ =>
object(CDbCriteria)[41]
public 'select' => string '*' (length=1)
public 'distinct' => boolean false
public 'condition' => string '((t.user_id LIKE :ycp0) OR (t.user_nmae LIKE :ycp1)) OR (country.id LIKE :ycp2)' (length=79)
public 'params' =>
array
':ycp0' => string '%1%' (length=3)
':ycp1' => string '%sudhakar%' (length=10)
':ycp2' => string '%1%' (length=3)
public 'limit' => int -1
public 'offset' => int -1
public 'order' => string '' (length=0)
public 'group' => string '' (length=0)
public 'join' => string '' (length=0)
public 'having' => string '' (length=0)
public 'with' =>
array
0 => string 'Country' (length=7)
1 => string 'State' (length=5)
public 'alias' => null
public 'together' => boolean true
public 'index' => null
public 'scopes' => null
private '_e' (CComponent) => null
private '_m' (CComponent) => null
private ‘_id’ (CDataProvider) => string ‘TblUser’ (length=7)
private ‘_data’ (CDataProvider) => null
private ‘_keys’ (CDataProvider) => null
private ‘_totalItemCount’ (CDataProvider) => null
private ‘_sort’ (CDataProvider) => null
private ‘_pagination’ (CDataProvider) => null
private ‘_e’ (CComponent) => null
private ‘_m’ (CComponent) => null
please give me right solutions