where clause / inner join

How to set up WHERE clauses and INNER JOIN conditions in ChronoForms.

Overview

The issue occurs when configuring a CC form with multiple models, requiring correct syntax for WHERE conditions and JOIN rules.
In the primary model, set the condition using an array format and specify the order field. For joined models, set the join type to 'inner' and define the join condition with an array linking the related fields.

Answered
ch 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 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.