Answer the question
In order to leave comments, you need to log in
How to choose a database connection?
There are two connections to the database, the first one is default. I need to switch to the second database during this request.
$cities = City::model()->findAll("name LIKE :name", array(':name'=>"%$query%"));
Answer the question
In order to leave comments, you need to log in
Here they write how to change the connection to the database in Yii-1. And also here ...
В настройках модели можно указать соединение. yii1 уже года 2 не видел, но изменить можно вот в этой функции -
public function getDbConnection() {}
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question