the task is to save the $model->image with row id in it. to anticipate the next autoincrement id i use the query below. mysql returns right result, but when i try to save this query result in model it saves it like 'Array' string. For example : article_Array_1516534305.png instead of article_13_1516534305.png
i tried to use array_shift() function, but result is the same
$connection = Yii::$app->getDb();
$dbName = $this->getDsnAttribute('dbname', Yii::$app->getDb()->dsn);
$query = new Query;
$query->select('AUTO_INCREMENT')
->from('information_schema.TABLES')
->where("TABLE_SCHEMA = '".$dbName."'")
->andWhere("TABLE_NAME = '".$this->tableName()."'");
$id = $query->one();
$this->image = 'article_'.$id.'_'.time(). '.' . $image->extension;