This is my code in controller
public function actionCharges($id){
$model= \app\models\IpdCharges::findOne(['doctor'=>$id]);
$model1= \app\models\PatientDetail::findOne(['tpa_name']);
$query = (new \yii\db\Query())
->select('tpa_name')
->from('patient_detail')
->innerJoin('daily_ward_entry',
'daily_ward_entry.general_regn_no = patient_detail.general_regn_no')
->where(['daily_ward_entry.id'=>$id]);
$command = $query->createCommand();
$rows = $command->queryAll();
//var_dump($rows);exit;
if ($rows === Null){
echo 'null';exit;
}else {
echo 'not null';exit;
}
}
If I am checking the var_dump I am getting the null and not null result correctly.
But otherwise I am always getting echoed only 'not null'
what I am doing wrong here.