relation problem - 'no column found' but column exists!

hi there,

i have a relation in my ForumThread Model




 'threadposts' => array(self::HAS_MANY, 'ForumPost', 'id_thread)'),



The ForumPost points to a table forum_post with id, id_thread, id_user, text, date_created.

Now i want to get all Posts to a Thread. As i wanted: A Thread has many Posts and foreign key is id_thread.

So i call:




    public function getThreadPosts($threadID) {

        return $this->with('threadposts')->findAll(array(

                    'condition' => 'id_thread = :id_thread',

                    'params' => array('id_thread' => $threadID),

                ));

    }



But the error says that no column id_thread was found:




The relation "threadposts" in active record class "ForumThread" is specified with an invalid foreign key "id_thread)". There is no such column in the table "forum_post". 



i dont understand the problem cause the logic seems to be clear? but not for yii so…

any ideas? thx.

You have a misstype:

‘id_thread)’ should be ‘id_thread’

See the closing parenthesis within the single quotes?

F********************!!!!!!!!!!!!!!!!!!!!!!!!!!!! :)

thx alot ;)