I'm currently creating my first Prestashop module, and I use the native function $helper to generate my configuration forms.
I'm ok when using the basic fonction "Configuration::get" but because the limited size of the table ps_configuration, I use a new sql table, and I wish to load the data of this table in my form.
Actually my module contain that code when querying the ps_configuration table :
$helper->fields_value['ZC_PREFOOTERBAND_DATA'] = $ZC_PREFOOTERBAND_DATA;
And I tried to query my customtable like this :
$query='SELECT `data`
FROM `'._DB_PREFIX_.'customtable`
WHERE `option` = \'ZC_PREFOOTERBAND_DATA\';';
$sql = Db::getInstance()->ExecuteS($query);
But my form still blank, I can't get my sql data.
Any idea ?
Thanks
I found the solution :)
I did a misstake with my variables ... To many variables, that's don't help ^^'
So the right solution to get the sql value is that one :
$query='SELECT `data`
FROM `'._DB_PREFIX_.'customtable`
WHERE `option` = \'ZC_HEALTHBAND_DATA\';';
$ZC_HEALTHBAND_DATA = Db::getInstance()->getValue($query);
$helper->fields_value['ZC_HEALTHBAND_DATA'] = $ZC_HEALTHBAND_DATA;