Yii Framework Forum: Select Statement Doesn't Work - Yii Framework Forum

Jump to content

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

Select Statement Doesn't Work Rate Topic: -----

#1 User is offline   yii 

  • Advanced Member
  • PipPipPip
  • Yii
  • Group: Members
  • Posts: 440
  • Joined: 25-July 09

Posted 04 December 2012 - 05:14 PM

Hi,

I add the select-statement to my find function and it doesn't work.
I get the error message

ActiveRecord "All" doesn't have the column "c.infitinitv in SELECT"...

$oTop = All::model()->cache(1000)->with($sRelation)->find(array(
	'select'		=>	'c.infinitiv', 			// << doesn't work
	'condition'		=>	"t.phrase LIKE :phrase",
	'params'		=>	array(':phrase' => $sQuery . "%" ),
	'order'		=>	'LENGTH(c.infinitiv) ASC',
	'group'		=>	'c.infinitiv',
	'limit'		=>	'1',
));


this work perfectly!
$oTop = All::model()->cache(1000)->with($sRelation)->find(array(
//	'select'		=>	'c.infinitiv', 			// << doesn't work
	'condition'		=>	"t.phrase LIKE :phrase",
	'params'		=>	array(':phrase' => $sQuery . "%" ),
	'order'		=>	'LENGTH(c.infinitiv) ASC',
	'group'		=>	'c.infinitiv',
	'limit'		=>	'1',
));


Where is the error?
Meine Fragen stelle ich öffentlich und baue somit eine Wissensdatenbank für andere auf!
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