First check SQL documentation Link
<http://zf2.readthedocs.org/en/release-2.0.3/modules/zend.db.sql.html> It
should make some things clear.
This is join construction (from docs):
$select->join(
'foo' // table name,
'id = bar.id', // expression to join on (will be quoted by platform
object before insertion),
array('bar', 'baz'), // (optional) list of columns, same requiremetns
as columns() above
$select::JOIN_OUTER // (optional), one of inner, outer, left, right
also represtned by constants in the API
);
This is short example:
$sql = new Sql($this->adapter);
$select = $sql->select();
$select->from(array('t' => 'first_table'));
$select->join(array('t2' => 'second_table'),
't.id = c.table_id',
array('title','active'),
'outer');
I hope it helps.
--
View this message in context:
http://zend-framework-community.634137.n4.nabble.com/How-to-left-outer-join-2-tables-tp4657874p4657876.html
Sent from the Zend Framework mailing list archive at Nabble.com.
--
List: [email protected]
Info: http://framework.zend.com/archives
Unsubscribe: [email protected]