Hi, 
Thank you for your reply.
Unfortunatelly I already know and use the array you talking about.

My problem is that my subquery is a join between 7 or 8 tables, 
and that array is something like  

 array('COUNT(*) AS number')

but zend framework's select object adds tablename.* for each table 
I've joined in my query, for example, my query become something like

SELECT COUNT(*) AS number, table1.*, table2.*, [...] tableN

And I get an error.
How to tell zend select to not add those fields?
Hope is clear.
Bye

Sergio Rinaudo



> Date: Thu, 23 Jul 2009 09:12:22 +1000
> From: [email protected]
> To: [email protected]
> CC: [email protected]
> Subject: Re: [fw-general] Problem with subquery
> 
> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
> 
> Sergio Rinaudo wrote:
> > Hi,
> > I have a subquery that causes the mysql error #1241 - Operand should
> > contain 1 column(s)
> > because zend select adds tablename.* fields within my subquery ( and it
> > will work without those tablename.* fields ).
> > How to disable this?
> 
> The second argument to the from() method is the fields you want to
> select from that table (it defaults to *). So, in your subquery, use:
> 
> $select = $db->select()->from('tablename', array())...
> 
> to select no columns, or add columns to the array if you need them.
> 
> - --
> 
> Brenton Alker
> PHP Developer - Brisbane, Australia
> 
> http://blog.tekerson.com/
> -----BEGIN PGP SIGNATURE-----
> Version: GnuPG v1.4.9 (GNU/Linux)
> Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org
> 
> iEYEARECAAYFAkpnnM8ACgkQ7bkAtAithuv4YgCePA+PsjkfXn9GOpGjUUMtiUD5
> MMgAn2MVdhQs5vUNiWK1WQDldQchnzGR
> =Rn8E
> -----END PGP SIGNATURE-----

_________________________________________________________________
Con Windows Live, puoi organizzare, modificare e condividere le tue foto.
http://www.microsoft.com/italy/windows/windowslive/products/photo-gallery-edit.aspx

Reply via email to