Answer the question
In order to leave comments, you need to log in
How to write data from a database to an array using Yii2?
Hello, it is not possible to write data from a selection of 2 related tables Language_description and language into an array. only the name parameter is written to the array
$languages = LanguageDescription::find()
->select([
'name',
'code'
])
->innerJoin('language', 'language.id = language_description.language_id')
->where(['LIKE', 'code', $query])
->orwhere(['LIKE', 'name', $query])
->all();
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