Forums

Read data db connect problem

999daniele 05 Oct, 2018
Hi Evryone,

i've a problem with my Chronoforms v6 ....

* i've create a "read_data6" that's connect with my db table "wrc_driver"
*the read_data6 in data setting have "return array of keys...."
* next i've create one dropdown that in the option fields have {var:read_data6}

the result is that i've my dropdown with ONLY one filed (the surname) but there 'nt the other table fields of my db ( name,value,age ecc.... )

where am i wrong?

thanks
GreyHead 05 Oct, 2018
Hi 999daniele,

Please drag a Debugger action into the On Load event, then load the form and post the debug - including the 'dummy emails' results here.

Bob
999daniele 05 Oct, 2018
hi thanks for your answare
this is the debugger result

my dropdown contains "Sebastien" and "Thierry" but not cognome,id,valore fields
Array
(
    [language] => it-IT
    [Itemid] => 465
    [option] => com_chronoforms6
    [lang] => it-IT
    [view] => form
    [ark_inine_enabled] => 
)
Array
(
    [read_data6] => Array
        (
            [log] => Array
                (
                    [0] => SELECT `Data6`.`id_wrc_driver` AS `Data6.id_wrc_driver`, `Data6`.`Nome` AS `Data6.Nome`, `Data6`.`Cognome` AS `Data6.Cognome`, `Data6`.`Valore` AS `Data6.Valore` FROM `wrc_driver` AS `Data6` LIMIT 100;
                )

            [var] => Array
                (
                    [1] => Sebastien
                    [2] => Thierry
                )

        )

)
GreyHead 05 Oct, 2018
Hi 999daniele,

The dropdown will only take two items for the text and value entries.

What result do you get if you copy and paste the SELECT query into PHPMyAdmin?

Bob
999daniele 05 Oct, 2018
hi,

in php my admin is correct
999daniele 05 Oct, 2018
how cain i for example show in my dropdown "id_wrc_driver" and "nome" only?

thanks
healyhatman 05 Oct, 2018
Post a screenshot of your read data action
999daniele 05 Oct, 2018
hi in attachment you have

read_data6 configuration (nome and valore )
dropdown result (only valore )
healyhatman 05 Oct, 2018
So if I'm reading your setup and also reading the image up the top showing your read data...... Then you're getting exactly what you're requesting. Valore appears to be 100 in each row, and you're using that as the label.
999daniele 05 Oct, 2018
I do not know if I'm explaining the right way ... I'll explain what I need:

in my db i've on table "wrc_driver"

that table,for example have that records:

nome: Sebastian
cognome: Ogier
valore: 100

nome: Thierry
cognome: Neuville
valore: 100

i want a dropbox that show:
- Ogier 100
-Neuville 100

how can i do?
healyhatman 05 Oct, 2018
Concat(model.field , ' ' , model.field2):model.alias
Pay attention to the spaces between the commas
999daniele 05 Oct, 2018
i've done:

Concat(Data6.nome , ' ' , Data6.cognome):Data6.count_alias

"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 'FROM `wrc_driver` AS `Data6` LIMIT 100' at line 1 SQL=SELECT FROM `wrc_driver` AS `Data6` LIMIT 100;"
999daniele 05 Oct, 2018
Solved:
Concat(Nome , ' ', Cognome , ' ' , Valore):Descrizione

wrong Upper nome (Nome) :-)))

thanks everone!
This topic is locked and no more replies can be posted.