I am new in Zend and relational database design.
I have two tables that I would like to join in one so that certain values
from 1st table are replaced with associated values from another table.
This query works:
SELECT a.iditems, a.model,
(SELECT name FROM headings WHERE idheadings = a.heading1) as heading1Name,
(SELECT name FROM headings WHERE idheadings = a.heading2) as heading2Name
from items as a;
I would like to to this kind of query with zend... is it possible?
currently i have this query but it only joins tables
$table = new Model_DbTable_Items();
$select = $table->select()
->setIntegrityCheck(false)
->from('items', array('iditems','model'))
->join('headings', 'headings.idheadings =
items.heading1')
->where('iditems = ?', '1');
$rows = $table->fetchAll($select);
Help would be greatly appreciated.
--
View this message in context:
http://www.nabble.com/Zend-joined-tables-query-tp24158616p24158616.html
Sent from the Zend Framework mailing list archive at Nabble.com.