Re: compleax query

2010-06-22 Thread Narendra Padala
Hi flocks, I am also new to cakephp ..is there any mistake excuse, try like this, $campaign_store_dates = $this->CampaignStoreDate->find('all', array('joins' => array(array( 'table' => 'stores',

Re: compleax query

2010-06-22 Thread Jeremy Burns | Class Outfit
Are you using the containable behaviour (highly recommended)? If so: $results = $this->CampaignStoreDate->find( 'all', array( 'contain' => array( 'Campaign', 'Store' ), 'fields' => array

Re: compleax query

2010-06-22 Thread rakeshyadav rakeshyadav
Hi all, Any body tell me the required cakephp query for below SQL query SELECT * FROM campaign_store_dates cd, campaigns c, stores s WHERE ( c.campaign_id = cd.campaign_id AND s.store_id = cd.store_id ) Thanks in advance, Rakesh Check out the new CakePHP Questions site http://cakeqs

Re: compleax query

2010-06-22 Thread Jeremy Burns | Class Outfit
I *think* you'd have to do it using the query method (which is generally frowned upon as a method of last resort). $this->Model->query($sql); Jeremy Burns Class Outfit jeremybu...@classoutfit.com http://www.classoutfit.com On 22 Jun 2010, at 06:47, rakeshyadav rakeshyadav wrote: > hi Good Morn

Re: compleax query

2010-06-22 Thread rakeshyadav rakeshyadav
hi Good Morning All, i am trying to execute complex SQL query like this, EXPLAIN SELECT * FROM campaign_store_dates cd, campaigns c, stores s WHERE ( cd.campaign_id = c.campaign_id AND cd.store_id = s.store_id AND cd.date BETWEEN '&01-06-2010&' AND '&01-06-2010&' ) Any one

Re: compleax query

2010-06-21 Thread Martin Radosta
If you fallow the naming convetion, conditions should be: 'cp.id = CampaignStoreDate.campaign_id' AND 'Store.id = CampaignStoreDate.store_id' Can you send us the resulting SQL? (debug level 2) Thanks MARTIN On 06/21/2010 09:21 AM, rakeshyadav rakeshyadav wrote: Hi All, i am

compleax query

2010-06-21 Thread rakeshyadav rakeshyadav
Hi All, i am trying to execute complex query like this, $storeDates = $this->CampaignStoreDate->find('all', array('joins' => array( array( 'type' => 'INNER', 'table' =>