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
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.
> 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.
> > 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 Jeremy...I changed the primary key in the Model Attribute and > works like a charm.
> On Feb 27, 11:01 am, jeremyharris <funeralm...@gmail.com> wrote: > > It sounds like you should probably just include your own 'join' 'key[1] > in > > your find statement then.
> > > 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.
> -- > 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 > cake-php+unsubscribe@googlegroups.com For more options, visit this group > at http://groups.google.com/group/cake-php