It seems like I have answered this question several times already this
week on fw-db and fw-general...

Zend_Db_Table has no support for joins.  You can write a SQL statement
that contains joins, and execute that SQL statement using methods of the
Zend_Db_Adapter class.

You can use Zend_Db_Select to help you construct the SQL.  Using
Zend_Db_Select is not required, but if you are not confident in your
knowledge of SQL syntax it might be helpful.  For example:

  $select = $db->select()->from('A')->join('B', $joinCondition);
  $result = $db->fetchAll($select);

The result is a plain PHP array, not a Zend_Db_Table_Rowset object.

Regards,
Bill Karwin

> -----Original Message-----
> From: Kexiao Liao [mailto:[EMAIL PROTECTED] 
> Sent: Friday, August 24, 2007 12:07 PM
> To: [email protected]
> Subject: [fw-general] Implement join table in Zend Framework
> 
> 
> What is the best approach to implement table join in Zend 
> Framework. For example, I have two tables: A & B, they need 
> to be joined based on condition $where. What is the best way 
> that we can implement this in Zend Framework?
> Any comments are highly appreciated.
> 
> --
> View this message in context: 
> http://www.nabble.com/Implement-join-table-in-Zend-Framework-t
> f4325213s16154.html#a12318170
> Sent from the Zend Framework mailing list archive at Nabble.com.
> 
> 

Reply via email to