"IN" and "NOT IN" statements Error

Use variables with IN and NOT IN conditions in ChronoForms v6.

Overview

The SQL syntax error occurs because the variable format is incorrect when passing arrays to IN/NOT IN conditions.
Use the syntax {var:your_variable_name} directly in the condition value field, where your_variable_name contains the array.

oc octav 27 Oct, 2020
Hello,
Please advise why i cannot us "NOT IN" and "IN" conditions (available in conditions dropdown). When using them i get error like in image.
Thanks



Max_admin Max_admin 27 Oct, 2020
Answer
use the array syntax:
{value:[1,2,3]}

Or better use v7 which has a multi select for this!
Max, ChronoForms developer
ChronoMyAdmin: Database administration within Joomla, no phpMyAdmin needed.
ChronoMails simplifies Joomla email: newsletters, logging, and custom templates.
oc octav 29 Oct, 2020
I would prefer to continue using v6 for a while. I have tried the above syntax and still error.
Actually i need this condition to in the read_data action:
Model.metakey IN ({var:list})
(where the list var is an array from a php action).
Any ideas how can i achieve this considering that IN and NOT IN conditions are not working in v6.
Max_admin Max_admin 29 Oct, 2020
if the value is an array then it should work, what does the debug show ?
Max, ChronoForms developer
ChronoMyAdmin: Database administration within Joomla, no phpMyAdmin needed.
ChronoMails simplifies Joomla email: newsletters, logging, and custom templates.
we webcrea 09 Nov, 2020
Hi,
I have the same issue
I tried
{value:(var:[tableau])} where tableau is an array
{value:(var:tableau)} where tableau is an array
And Itried {value:(var:chaine)} where chaine is like 47,48,49
All give an error
​[h1]1064[/h1][h2]You
have an error in your SQL syntax; check the manual that corresponds to
your MySQL server version for the right syntax to use near
''(var:tableau)'' at line 1 [/h2]


Notice that with directly the value like {value:[47,49,48]} it works.
The fact is how to pass a var in this condition?
Thanks
ps : in mysql the query works.
Chris
Max_admin Max_admin 10 Nov, 2020
1 Likes
what about {var:tableau} ?
Max, ChronoForms developer
ChronoMyAdmin: Database administration within Joomla, no phpMyAdmin needed.
ChronoMails simplifies Joomla email: newsletters, logging, and custom templates.
we webcrea 10 Nov, 2020
Very nice, that's work well
Thanks Max
This topic is locked and no more replies can be posted.