Forums

db read doesn work properly

samir1903 11 Apr, 2019
Answer
db read fields to retreive
SUM(Data16.mercadeo):mercadeo_count
select first matching item there is not where condition

-------------
chronoconnectivity index page
{fn:read_data16.Data16.mercadeo_count}
--------------------
debug
Array
(
    [option] => com_chronoconnectivity6
    [cont] => manager
    [conn] => empresa
)
Array
(
)
when i change
index page to
{fn:read_data16}
it gives this output which is correct but i cannot write just 6
the same think in chronoforms it gives me 6 correctly???
Array
(
    [option] => com_chronoconnectivity6
    [cont] => manager
    [conn] => empresa
)
Array
(
    [read_data16] => Array
        (
            [log] => Array
                (
                    [0] => SELECT SUM(`Data16`.`mercadeo`) AS `Data16.mercadeo_count` FROM `os5pk_chronoforms_data_empresa_reg` AS `Data16`;
                )

            [var] => Array
                (
                    [Data16] => Array
                        (
                            [mercadeo_count] => 6
                        )

                )

        )

)
healyhatman 13 Apr, 2019
You need to use {fn:} to run the function first, and then the result is available under {var:}

So it should be
{fn:read_data16}
{var:read_data16.Data16.mercadeo_count}

Also, you should rename the read_data16 and the Data16 to something more useful. Just a tip.
This topic is locked and no more replies can be posted.