Answer the question
In order to leave comments, you need to log in
How to select all values for a given field?
Good afternoon. Let's assume there is a table
id title subtitle description
1 11 14 17
2 12 15 18
3 13 16 19
How would a select query in Yii look like if you need to pick up all the values of the description field, i.e.
you need to pick up 17,18,19. Thanks in advance)
Answer the question
In order to leave comments, you need to log in
Option Andrey Tokmakov selects all "description". Here is an option that will select everything where description is 17 or 18 or 19:
$arr = [17,18,19];
$model = Model::find()->where(['description'=>$arr])->all();
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question