2010-12-06 50 views
2

我得到正是这个错误:PropelException [0]:无法确定该列绑定到参数在第

PropelException [ 0 ]: Cannot determine the column to bind to the parameter in clause 

这是我试图运行代码:

$myObject = MyObjectQuery::create() 
    ->where('MyObject.another_object_id = ?', $foreignKey) 
    ->find(); 

也尝试这种代码,这给了我非常相同的异常

$myObject = MyObjectQuery::create() 
    ->where('MyObject.anotherObjectId = ?', $foreignKey) 
    ->find() 

我的MySQL数据库表被称为“my_object”,并有一个脱颖而出ignkey命名为“another_object_id”。我究竟做错了什么?

回答

2

也许尝试:

$myObject = MyObjectQuery::create() 
    ->where('anotherObjectId = ?', $foreignKey) 
    ->find(); 

$myObject = MyObjectQuery::create() 
    ->filterByAnotherObjectId($foreignKey) 
    ->find();