Answer the question
In order to leave comments, you need to log in
Get array with all user ids from database after find() yii2?
I get all users without a ban from the database, tell me how to get an array with only the id of all users.
$ids = Users::find(["baned" => $no ])
->all();
tried $ids_array = $ids['id']; does not work.
Answer the question
In order to leave comments, you need to log in
$ids = Users::find(["baned" => $no ])->select("id")->asArray()->column()
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question