ChronoEngine.com homepage

Forums

Please write a review for the extension you are using on the Joomla extensions directory before posting a new question as we are being spammed by many negative reviews.

Thank you for your support!

Or condition in where clause

webcrea 09 Oct, 2017
Hi,

In read_data in where conditions I have

fonds.notreSelection:{data:notre_selection}/-
fonds.published:{data:cbox_published}/-
fonds.sg_id:{data:select_sg}/-
fonds.natureProduit:{data:select_type}/-
fonds.natureProduit1:{data:select_type}/-
fonds.millesime:{data:select_mille}/-

and i would want something like this

fonds.notreSelection:{data:notre_selection}/-
fonds.published:{data:cbox_published}/-
fonds.sg_id:{data:select_sg}/-
fonds.natureProduit:{data:select_type}/- OR fonds.natureProduit1:{data:select_type}/-
fonds.millesime:{data:select_mille}/-

Do you nhave any idea please ?
thanks
Max_admin 10 Oct, 2017
1 Likes
Hi Christophe,

You can use different strings in the conditions box to build a complex query:
fonds.notreSelection:{data:notre_selection}/-
AND
(
fonds.notreSelection:{data:notre_selection}/-
OR
fonds.notreSelection:{data:notre_selection}/-
)

Best regards
Max
ChronoForms developer...
Did you try ChronoMyAdmin for managing your Joomla database tables ?
webcrea 10 Oct, 2017
Thanks Max,

fonds.millesime:{data:select_mille}/-
AND
(
fonds.natureProduit:{data:select_type}
OR
fonds.natureProduit1:{data:select_type}
)

no /- at the end
webcrea 12 Oct, 2017
With this, it works but if 2 fields (natureProduit and natureProduit1) are not empty the data doesn't appear. The filter select_type is empty '' and only data with one field empty appears.

If I add /- an at the end error occurs

fonds.notreSelection:{data:notre_selection}/-
fonds.published:{data:cbox_published}/-
fonds.sg_id:{data:select_sg}/-
fonds.millesime:{data:select_mille}/-
AND
(
fonds.natureProduit:{data:select_type}
OR
fonds.natureProduit1:{data:select_type}
)

I need this AND (OR) doesn't work if select_type is empty.
Do you know what I mean?
Thanks
Regards
Max_admin 28 Nov, 2017
Hi Christophe,

Apologizes for the late reply here!

You can use PHP code in the conditions box in order to switch the returned active conditions.

Best regards
Max
ChronoForms developer...
Did you try ChronoMyAdmin for managing your Joomla database tables ?
This topic is locked and no more replies can be posted.

2Checkout.com

2CheckOut.com Inc. (Ohio, USA) is an authorized retailer for goods and services provided by ChronoEngine.com