Forums

where clause / inner join

chrissy6930 31 May, 2014
hi all,

while I've read this FAQ I have trouble figuring how to set up the where clasue and join rule for my CC form with the above syntax

3 models:
model1:Cats
model2:Furs
model3:Eyes


SELECT ‘Cats’.* FROM #__cats AS ‘Cats’
INNER JOIN `#__furs` AS `Furs` ON `Cats`.`fur`=`Furs`.`cf_id`
INNER JOIN `#__eyes` AS `Eyes` ON `Cats`.`eye`=`Eyes`.`cf_id`
WHERE ` Cats’`.`cf_id` > 0
ORDER BY ` Cats`.`name`

in model 1
under conditions I should enter a modified
`Cats`.`cf_id` > 0
ORDER BY `Cats`.`name`

and in models2&3
I have join type set to inner and
fields set to cf_id,name
under join condition I should enter
`Cats`.`fur`=`Furs`.`cf_id` / `Cats`.`eye`=`Eyes`.`cf_id`
in the appropriate format

could you pls help me out?
Max_admin 04 Jun, 2014
Answer
1 Likes
Hi Chriss,

In model 1 conditions:

<?php
return array("Cats.cf_id >" => "0");

Order:
Cats.name

Model2 join conditions:

<?php
return array("Cats.fur = Furs.cf_id");


Model3 same like #2

Regards,
Max
Max, ChronoForms developer
ChronoMyAdmin: Database administration within Joomla, no phpMyAdmin needed.
ChronoMails simplifies Joomla email: newsletters, logging, and custom templates.
This topic is locked and no more replies can be posted.