Yii Framework Forum: Relations dont work after I updated Yii - Yii Framework Forum

Jump to content

Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

Relations dont work after I updated Yii 'order'=>'??.description asc' Rate Topic: -----

#1 User is offline   leandrofranca 

  • Junior Member
  • Pip
  • Yii
  • Group: Members
  • Posts: 24
  • Joined: 19-January 09
  • Location:Salvador, Bahia, Brasil

Posted 17 January 2010 - 12:00 PM

Why this relation dont work more after I updated from Yii 1.0.11 to 1.1.0?

'Cities'=>array(self::HAS_MANY,'City','stateId','order'=>'??.description ASC'),

Exception:
 [exception.CDbException] exception
'CDbException' with message 'CDbCommand failed ... SQL: SQLSTATE[42000]: Syntax error or access violation: 1064 ...  '??.descricao ASC' line 1'
in /home/standdocorretor/yii/framework/db/CDbCommand.php:375


Some thing was changed?

Thks
0

#2 User is offline   Mike 

  • Elite Member
  • PipPipPipPipPip
  • Yii
  • Group: Members
  • Posts: 3,016
  • Joined: 06-October 08
  • Location:Upper Palatinate

Posted 17 January 2010 - 12:05 PM

Rule #1 before upgrading: Read the upgrade notes ;)
http://www.yiiframew...c/guide/upgrade
0

#3 User is offline   betelgeuse 

  • Junior Member
  • Pip
  • Yii
  • Group: Members
  • Posts: 99
  • Joined: 12-January 09

Posted 17 January 2010 - 12:32 PM

View Postleandrofranca, on 17 January 2010 - 12:00 PM, said:

Why this relation dont work more after I updated from Yii 1.0.11 to 1.1.0?

'Cities'=>array(self::HAS_MANY,'City','stateId','order'=>'??.description ASC'),

Exception:
 [exception.CDbException] exception
'CDbException' with message 'CDbCommand failed ... SQL: SQLSTATE[42000]: Syntax error or access violation: 1064 ...  '??.descricao ASC' line 1'
in /home/standdocorretor/yii/framework/db/CDbCommand.php:375


Some thing was changed?

Thks


'Cities'=>array(self::HAS_MANY,'City','stateId','order'=>'??.description ASC'),


just remove ??.
a code snippet says more than a thousand words
0

#4 User is offline   leandrofranca 

  • Junior Member
  • Pip
  • Yii
  • Group: Members
  • Posts: 24
  • Joined: 19-January 09
  • Location:Salvador, Bahia, Brasil

Posted 17 January 2010 - 01:35 PM

View PostMike, on 17 January 2010 - 12:05 PM, said:

Rule #1 before upgrading: Read the upgrade notes ;)
http://www.yiiframew...c/guide/upgrade


Thanks, I did not know this guide but it's great to know.

View PostFlavio, on 17 January 2010 - 12:32 PM, said:

'Cities'=>array(self::HAS_MANY,'City','stateId','order'=>'??.description ASC'),


just remove ??.


Thanks, that helped me a lot.
0

Share this topic:


Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

1 User(s) are reading this topic
0 members, 1 guests, 0 anonymous users