Код: Выделить всё
public function actionSearchAjax($term, $current = null) {
$data = [];
if(is_string($term) && strlen($term) >= 3) {
$result = Concert::find()->select(['id', 'title'])->where(['like', 'title', ':term'])
->andFilterWhere(['!=', 'id', ':current'])->params([':term' => $term, ':current' => $current])
->asArray()->all();
if(count($result)) $data = $result;
}
return Json::encode($data);
}
.SQLSTATE[HY093]: Invalid parameter number: number of bound variables does not match number of tokens
Что я делаю не так?