I am getting the following error: Invalid use of table with UNION
MySQL version: 5.0.6
class Chemdb extends Zend_Db_Table
{
protected $_name = 'chemdb';
protected $_dependentTables = array('users','cmgdb');
/*
*Build Chemical List for Search
*/
public function buildlist($order) {
$select1 = parent::select();
$select1->from($this->_name, array(
'title',
'cas',
'synonyms'
));
$select2 = parent::select();
$select2->from('cmgdb', array(
'title',
'materialid AS cas',
'synonyms'
));
$select3 = parent::select();
$select3->union(array($select1,$select2));
//$sql = '(SELECT title,cas,synonyms FROM chemdb) UNION (SELECT
title,materialid AS cas,synonyms FROM cmgdb) ORDER BY title';
$results = parent::fetchall($select3);
return $results;
}
}
Is this method still in the trunk or should this be working?
Thanks - LK
--
View this message in context: http://www.nabble.com/Feature-request%3A-Zend_Db_Select-UNION-tp16511719p22611974.html
Sent from the Zend DB mailing list archive at Nabble.com.
没有评论:
发表评论