Thanks Jeremy...I changed the primary key in the Model Attribute and works like a charm.
On Feb 27, 11:01 am, jeremyharris <[email protected]> wrote: > It sounds like you should probably just include your own 'join' 'key[1] in > your find statement then. > > 1:http://book.cakephp.org/1.3/en/view/1047/Joining-tables > > > > On Sunday, February 26, 2012 4:15:18 PM UTC-8, padma wrote: > > > Hi, > > > I have the model configured with belongsto association. > > > In this the query outputted looks like > > > SELECT `Firstpage`.`firstpagesid`, `Firstpage`.`imgnum`, > > `Firstpage`.`pageloc`, `Firstpage`.`desc_id`, > > `actressdesctbl`.`actressnum`, `actressdesctbl`.`actressfname`, > > `actressdesctbl`.`description`, `actressdesctbl`.`imgloc` FROM > > `firstpages` AS `Firstpage` INNER JOIN `actressdesctbls` AS > > `actressdesctbl` ON (`Firstpage`.`desc_id` = `actressdesctbl`.`id`) > > WHERE `firstpage`.`pageloc` = 1 ORDER BY `firstpage`.`imgnum` asc > > > The model association is listed below as well > > > class firstpage extends AppModel { > > > public $name = 'firstpage'; > > public $belongsTo = array( > > 'actressdesctbl' => array( > > 'className' => 'actressdesctbl', > > 'foreignKey' => 'desc_id', > > 'type' => 'INNER' > > ) > > ); > > } > > > Here the inner join is between desc_id in the firstpages table and > > the id in the actressdesctbl. I dont want the inner join to default > > to id in the actressdesctbls. Instead i have another column in the > > same table to which I need to join...Can I override the default...I > > dont want to use any prepared statement. > > > Thanks for your help. > > > Thanks > > padma Kumar- Hide quoted text - > > - Show quoted text - -- Our newest site for the community: CakePHP Video Tutorials http://tv.cakephp.org Check out the new CakePHP Questions site http://ask.cakephp.org and help others with their CakePHP related questions. To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/cake-php
