2010-12-06 33 views
2

je reçois exactement cette erreur:PropelException [0]: Impossible de déterminer la colonne à lier au paramètre à la clause

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

C'est le code que je suis en train de courir:

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

est également essayé ce code, ce qui m'a donné la même exception

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

Ma table de base de données MySQL est appelée « mon_objet » et a un avant ignkey nommé "another_object_id". Qu'est-ce que je fais mal?

Répondre

2

Peut-être essayer:

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

ou

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