mysql - Column not found error in Criteria -
i'm working on symfony project , need query many many relationship, made criteria based function query database:
//create criteria object $c1 = new criteria(); //selecting rows in link table matches table1 id (parameter) $c1->add(linktablepeer::tbl1_codigo,$parameter,criteria::equal); //selecting rows in table2 matched last query $c1->addjoin(linktablepeer::tbl2_codigo,table2peer::tbl2_codigo); $list = linktablepeer::doselect($c1);
but throws me strange error
[wrapped: sqlstate[42s22]: column not found: 1054 unknown column 'link_table.id' in 'field list']
is strange because have no column named id in table. why happening? how can fix it?
the question in other words:
is there option php symfony propel:build-model
command prevents generating "id" column tables don't have primary key? thank time ;)
i've found problem the dump command task trying export view in mysql database. when defined tables wanted export using -classes="..."
, error went away.
for example:
symfony propel:data-dump --classes="{table},{tablew},..." fixtures.yml
Comments
Post a Comment