我得到了这个错误:
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”的外键。我做错了什么?
答案 0 :(得分:2)
也许试试:
$myObject = MyObjectQuery::create()
->where('anotherObjectId = ?', $foreignKey)
->find();
或
$myObject = MyObjectQuery::create()
->filterByAnotherObjectId($foreignKey)
->find();