Forums

CF7- Read Data - php conditions

mayergreenberg259 07 Mar, 2024
In cf7, in the read data action, how do I make a complicated condition:
I understand how to make a simple condition where I just test for "=" or "!=". It look like this ["Table.Column", "TestValue" , "="].
But how do I test if the Table.Column value is in an array of values? Like this: ["Table.Column", "TestValue1, TestValue2" , "IN"] ?
It doesn't work. Can someone show me how to make it work?

Also, when returning the array of conditions, they are all 'AND'. How do I make them 'OR'?
Max_admin 07 Mar, 2024
you can use the SQL data action, and in v8 you can also write the WHERE part of the query directly
Max, ChronoForms developer
ChronoMyAdmin: Database administration within Joomla, no phpMyAdmin needed.
ChronoMails simplifies Joomla email: newsletters, logging, and custom templates.
mayergreenberg259 07 Mar, 2024
But how can I connect the sql data action to the table list view?
Max_admin 07 Mar, 2024
you should use the returned data using the variable as the data source for the table view:
{var:sql_data_name}
Max, ChronoForms developer
ChronoMyAdmin: Database administration within Joomla, no phpMyAdmin needed.
ChronoMails simplifies Joomla email: newsletters, logging, and custom templates.
mayergreenberg259 08 Mar, 2024
Back to the original question:
Once I am using the php conditions, how can I make the conditions into 'OR'?
Max_admin 16 Mar, 2024
Answer
do not use PHP conditions, use SQL Data action or v8 "Where" behavior

for SQL Data you can write the full query however you want

for v8 Where you can write your own where query
Max, ChronoForms developer
ChronoMyAdmin: Database administration within Joomla, no phpMyAdmin needed.
ChronoMails simplifies Joomla email: newsletters, logging, and custom templates.
You need to login to be able to post a reply.