2009年4月14日星期二

[fw-db] Select a rowset with a join for order

Hello,

 

I want to select a rowset from a table and I want to order the set with a column from another table. I don’t need the information from the other table.

Is this possible?

With the code I have I only get an array

 

    $tabel = new Model_Kolom();

    $select = $tabel->select();

    $select->setIntegrityCheck(false)

          ->join('dbi.groepskolom','dbi.groepskolom.kolomnaam=dbi.kolommen.naam,dbi.groepskolom.tabel_naam=dbi.kolommen.tabel_naam')

          ->where('dbi.groepskolom.groepsnaam=?',$this->naam)

          ->order('groepskolom.positie');

    $this->kolommenArray = $tabel->fetchAll($select)->toArray();

 

Model_Kolom only set the table name, the database schema and the rowclass

My database is Postgresql

 

Regards,

Tobias van Beek

没有评论: