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',
Are you using the containable behaviour (highly recommended)? If so:
$results = $this->CampaignStoreDate->find(
'all',
array(
'contain' => array(
'Campaign',
'Store'
),
'fields' => array
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
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
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
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
Hi All,
i am trying to execute complex query like this,
$storeDates = $this->CampaignStoreDate->find('all',
array('joins' => array(
array(
'type' => 'INNER',
'table' =>