I am going to execute the below query in yii2.
$result = MyModel::find()->where(['res_model'=>$res_model])->all();
What is the difference between the above request and one request:
$result = MyModel::find()->where( 'res_model = :res_model',[
':res_model' => $res_model] )->all();
both work fine, but a bit confusing both performance and usability. can someone please clarify on these please ??
source
share