Error when using loadModel

Hello,

Does every one know why I using $this->loadModel(id) bring me an error like this:

I have no idea for this error, help me please :mellow:

Sorry cant help you

You should post this under General Discussion for Yii 1.1.x since its not a feature request

Note: topic moved to proper forum - general Discussion for Yii 1.1.x

As for the problem… seems that you have a condition in the query, but you did not provide a value…

To help you better you would need to post here the query that trigers this error…

I dont know why? when I use loadModel() in actionIndex():




        public function actionIndex()

	{ 

               $this->loadModel(2);

	}



But when I try it in another controller, it work fine?!

Probably the model being called by the controller doesn’t have the primary key of value 2?

What is the primary key for this table… is it a composite key ?

Check this similar topic - http://www.yiiframework.com/forum/index.php?/topic/15528-cactiverecord-strange-issue/