CF8 and SQL action

How to use results from one SQL query in another SQL query in ChronoForms 8.

Overview

The problem is that ChronoForms 8 does not directly support the same variable syntax as CF7 for passing query results between SQL actions.
Use the Read Data action with either the PHP or SQL Code behavior to write a custom query that combines both SQL statements, allowing you to use the results of the first query as input for the second.

Answered
ChronoForms v8
Co Colnem 19d ago

Hi

How to do someone like this in CF8 ?

CF7 SQL Action sql_data1 :SELECT username FROM #__users LIMIT 2;

CF7 SQL Action sql_data2 :SELECT username, name FROM #__users WHERE username IN ('{var.join[', ']:sql_data_1.[n].username}');

Thanks

Co Colnem 18d ago

Thanks

But how I do that in message action?

<p>{var.in:read_data_6.[n].id}/</p>

.[n]. doesn't work in CF8...

Is there a manual for CF8 like CF6?

Thanks

Co Colnem 17d ago

Hi

I Want to have this in a HTML view (CF7 Syntax):

{var.pr:read_data6}

Array(    [0] => Array        (            [model] => Array                (                    [id] => 2010                    [label] => Billard                )

        )

    [1] => Array        (            [model] => Array                (                    [id] => 2030                    [label] => Jeux de société                )

        )

)

{var.pr:read_data6.[n].model.id}

Array(    [0] => 2010    [1] => 2030)

Is it possible with CF8? {var.in:read_data6.model.id} doesn't work.

Thanks

Post a Reply