Answer the question
In order to leave comments, you need to log in
What is the difference between the two database approaches?
The question is very noobish, but I still can’t understand, I would really like to get an answer in an understandable language
In general: I write on the Yii2 framework, we can get data from the model using ActiveRecord like this:
News::find()->where(['moderate' => 1])->orderBy(['id' => SORT_DESC])->all();
$posts = Yii::$app->db->createCommand('SELECT * FROM news WHERE moderate =:moderate ORDER BY DESC')->bindValue(':moderate', 1)->queryAll();
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question