Re: [fw-general] Zend_Db_Select::union() behaving

2009-09-21 Thread Benjamin Eberlei
On Monday 21 September 2009 10:29:59 pm william0275 wrote:
> I just noticed this and wasted some time trying to debug my code until I
> found this bug in the documentation. I'm not sure why and how they added
> this change.

hello, the API docs are wrong about how union works. It has to be used:

$selectA = $db->select()->...;
$selectB = $db->select()->...;

$unionSelect = $db->select()->union(array($selectA, $selectB));

the docs where changed only recently on this issue, so expect this problem to 
be vanished in 1.9.3, aswell as this absurd bug you mentioned.

greetings,
Benjamin

-- 
Benjamin Eberlei
http://www.beberlei.de


Re: [fw-general] Zend_Db_Select::union() behaving

2009-09-21 Thread william0275

I just noticed this and wasted some time trying to debug my code until I
found this bug in the documentation. I'm not sure why and how they added
this change.
-- 
View this message in context: 
http://www.nabble.com/Zend_Db_Select%3A%3Aunion%28%29-behaving-tp21716437p25530470.html
Sent from the Zend Framework mailing list archive at Nabble.com.



[fw-general] Zend_Db_Select::union() behaving

2009-01-28 Thread kirpit
Hi,

I'm using ZF 1.7.3 and first time tried to union with ZF. In phpDoc section
it says;
/* The first parameter $select can be a string, an existing Zend_Db_Select
object or an array of either of these types. */

And what it does on the first a few lines of function is;
if (!is_array($select)) {
  $select = array();
}

Even i pass the zend_db_select object in an array, it produces sql query in
a logic like;
SELECT t1.fields*
*SELECT t2.fields* *
FROM t2
WHERE t2.conditions
FROM t1
WHERE t2.conditions

I'm using mysqli connection type with version 5.1.11