php - Zend Framework Query -


Can someone help me do this correctly? I mean: $ db-> select () -> group ..... I tried a few times but does not work for me: (

$ the-> q- > FetchAll ('Select * from clubs, club_photos_default where Clubs.id = club_photos_default.c_id group by club. Id');

Best relationship,

In this case, you are doing this correctly because the entire SQL query is known and static.

> Zend_Db_Select is not required to use questions In fact, it is often more complex and least readable, just type the textual SQL query.

Use Zend_Db_Select When you use < Em> Required

But to answer your question, it should work:

  $ select = $ Db-> Select () -> gt; ;; (Ar ('c' = & gt; 'club')) - & gt; Join (array ('P' => 'club_photos_default'), 'c.id = p.c_id') - & gt; Group ('c.id'); $ This- & gt; Q- & gt; FetchAll ($ selection);  

( $ db value is an object of Zend_Db_Adapter .)


Comments

Popular posts from this blog

c++ - Linux and clipboard -

What is expire header and how to achive them in ASP.NET and PHP? -

sql server - How can I determine which of my SQL 2005 statistics are unused? -