PropelException [0]:无法确定要绑定到子句中的参数的列

时间:2010-12-06 19:05:31

标签: propel

我得到了这个错误:

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”,并且有一个名为“another_object_id”的外键。我做错了什么?

1 个答案:

答案 0 :(得分:2)

也许试试:

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

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