Словил непонятный глюк с AR и Relation

Предварительное обсуждение найденных ошибок перед отправкой их авторам фреймворка, а также внесение новых предложений.
Ответить
maxyc
Сообщения: 124
Зарегистрирован: 2010.01.13, 09:11

Словил непонятный глюк с AR и Relation

Сообщение maxyc »

две модели,
User (id, country_id, name)
Country(id, title)

User: 'country'=>array(self::BELONGS_TO, 'Country', 'country_id'),
CDbCommand не удалось исполнить SQL-запрос: SQLSTATE[42S22]: Column not found: 1054 Unknown column 'country.' in 'where clause'. The SQL statement executed was: SELECT `country`.`id` AS `t1_c0`, `country`.`title_ru` AS `t1_c1`, `country`.`title_ua` AS `t1_c2`, `country`.`title_be` AS `t1_c3`, `country`.`title_en` AS `t1_c4`, `country`.`title_es` AS `t1_c5`, `country`.`title_pt` AS `t1_c6`, `country`.`title_de` AS `t1_c7`, `country`.`title_fr` AS `t1_c8`, `country`.`title_it` AS `t1_c9`, `country`.`title_pl` AS `t1_c10`, `country`.`title_ja` AS `t1_c11`, `country`.`title_lt` AS `t1_c12`, `country`.`title_lv` AS `t1_c13`, `country`.`title_cz` AS `t1_c14` FROM `_countries` `country` WHERE (`country`.``=:ypl0). Bound with :ypl0='1'
почему то поле для поиска не подставляется %)
скопы все отключил. просто выборка работает. через связи не работает
maxyc
Сообщения: 124
Зарегистрирован: 2010.01.13, 09:11

Re: Словил непонятный глюк с AR и Relation

Сообщение maxyc »

вопрос решен. на таблице countries не стоял Primary key
Loki000
Сообщения: 1
Зарегистрирован: 2014.12.23, 13:01

Re: Словил непонятный глюк с AR и Relation

Сообщение Loki000 »

CDbCommand не удалось исполнить SQL-запрос: SQLSTATE[42S22]: Column not found: 1054 Unknown column 'country.' in 'where clause'. The SQL statement executed was: SELECT `country`.`id` AS `t1_c0`, `country`.`title_ru` AS `t1_c1`, `country`.`title_ua` AS `t1_c2`, `country`.`title_be` AS `t1_c3`, `country`.`title_en` AS `t1_c4`, `country`.`title_es` AS `t1_c5`, `country`.`title_pt` AS `t1_c6`, `country`.`title_de` AS `t1_c7`, `country`.`title_fr` AS `t1_c8`, `country`.`title_it` AS `t1_c9`, `country`.`title_pl` AS `t1_c10`, `country`.`title_ja` AS `t1_c11`, `country`.`title_lt` AS `t1_c12`, `country`.`title_lv` AS `t1_c13`, `country`.`title_cz` AS `t1_c14` FROM `_countries` `country` WHERE (`country`.``=:ypl0). Bound with :ypl0='1'
Try out our free 350-050 braindumps and latest comptia Test king training courses to get high flying success in final the-berklee and www.northeastern.edu exams, mcts College of Notre Dame of Maryland is also very useful tool.
Ответить