[symfony-users] doctrine query with multiple joins

2011-02-20 Thread charanjeet
Hi I have got doctrine queries that operate on multiple tables and even across databases. Where should i place these? Model classes dont seem appropriate for it. Does it make sense to keep these queries in a library class. Please help. Regards Charanjeet Kaur -- If you want to report a vulner

Re: [symfony-users] doctrine query and not in (select ...) doesnt work

2010-10-24 Thread Stéphane
Perhaps you should add an alias in the subquery for the table ? Regards, Before Printing, Think about Your Environmental Responsibility! Avant d'Imprimer, Pensez à Votre Responsabilitée Environnementale! On Sun, Oct 24, 2010 at 4:33 PM, axel at wrote: > hello, > > I need the follwing query: >

[symfony-users] doctrine query and not in (select ...) doesnt work

2010-10-24 Thread axel at
hello, I need the follwing query: -> select * from person p where ... and (p.personid not in (select personid form person2building...) where person2building is an m:n relation connecting person and building table via primary keys the following doctrine query $q = Doctrine_Query::create()

[symfony-users] doctrine query help needed

2010-09-07 Thread Shihab KB
dear friends, I have the following tables. News [id, title, …] Education [id, title…..] Health [id, title, ….] ContentImage [id, contented (id of the News, Education, Health), type (like News, Education, Health), path…] The News, Education, Health may or may not have images in the ContentImage t

[symfony-users] Doctrine Query Cache and Symfony Pagers

2010-08-19 Thread Lea Haensenberger
Hi all, I'm having trouble with the doctrine query cache in combination with pagers. I have a query with some inner and left joins that I use with a pager. The pager then creates a subquery to get the right amount of rows from the db: SELECT * FROM table1 c LEFT JOIN table2 c2 ON c.id = c2.id INN

[symfony-users] Doctrine Query Left Join

2010-06-25 Thread Jérémie
Hi, I have this mysql query : SELECT n1.*, n2.* FROM ElementNode n1 LEFT JOIN ElementNode n2 ON n1.id = n2.nodeSubnodeOf I translated it this way: $this->nodes = Doctrine::getTable('ElementNode') ->createQuery() ->select('*, n2.*') ->leftJoin('ElementNode n2 ON id = n2.nodeSubnodeOf') ->execute(

[symfony-users] Doctrine query. Where conditions grouped.

2010-01-30 Thread Matías López
Hello Guys, I'm wondering how to create a doctrine query with this structure: SELECT * FROM table1 WHERE (field1 = $var1 and field2 = $var2) OR (field1 = $var3 and field2 = $var4) I know this would be possible using something like $q->andWhere('field1 = ? and field2 = ?',array($var1,$var2)); $q

Re: [symfony-users] Doctrine Query

2009-12-01 Thread Alexandre Salomé
Didn't understood your 2 methods to check result : 1. Executing MySQL with the console client (or PHPMyAmin, or other) 2. Executing with Doctrine Is it OK ? Give us more details, where do you execute it ? Have you checked your parameter ? How do you render/view the result of "Only 1 is ret

[symfony-users] Doctrine Query

2009-11-30 Thread jilomgv3
Well, I really need help. This might be a stupid error but I can't figure it out symfony 1.2 / Doctrine sfDoctrineGuardUser sfDoctrineApplyPlugin schema for the apply / business logic is : sfGuardUserProfile: tableName: sf_guard_user_profile columns: id: { type

[symfony-users] Doctrine Query

2009-11-10 Thread Murali Krishna B
Hi all, I have a table 'sample' with two columns: course_id and student_id. It is a many-to-many relationship table between Course and Students. Now I am facing a problem with Doctrine_Query. I am able to run this query in mysql prompt. select(course_id as cid,count(*) from sample where course_

[symfony-users] Doctrine, query arguments while fetching relations objects

2008-09-22 Thread Thomas Rabaix
Hello, In propel it is possible to provide a Criteria objet when fetching relations. This can be used to fetch, for instance, all blog comments ordered by date. How can we achieve this with doctrine ? I quickly look to the code and maybe the Doctrine_Relation::fetchRelatedFor should get a secon