Forum
Calc Builder Support
Calc Builder supportForums
Public write access is disabled. Please login
can I use _name from sql option list? 13.11.2014 22:23
I have created a multi option list using an sql query and successfully used the value in a calculation for price of my product
I would like to use the option key or name in the description and as far as I can tell from the Quick Guide this should be available as $myvar_name however this is does not produce anything?
Is the _name functionality available for an sql generated list?
Many Thanks
Simon
I would like to use the option key or name in the description and as far as I can tell from the Quick Guide this should be available as $myvar_name however this is does not produce anything?
Is the _name functionality available for an sql generated list?
Many Thanks
Simon
Re: can I use _name from sql option list? 14.11.2014 09:41
Hello,
Option List from sql query is a special feature of option list, and _name suffix is not available. You should get value as $myvar. You could write a query in code to get other value from your table, like this:
$db =JFactory::getDBO();
$query="select OTHER_VALUE from #__MYTABLE where ID=".$myvar;
$db->setQuery($query);
$result=$db->loadResult();
$newvalue=$result->OTHER_VALUE;
Regards,
Edited by MSTeam - 14.11.2014 09:46
Moonsoft Team
www.moonsoft.es
Option List from sql query is a special feature of option list, and _name suffix is not available. You should get value as $myvar. You could write a query in code to get other value from your table, like this:
$db =JFactory::getDBO();
$query="select OTHER_VALUE from #__MYTABLE where ID=".$myvar;
$db->setQuery($query);
$result=$db->loadResult();
$newvalue=$result->OTHER_VALUE;
Regards,
Edited by MSTeam - 14.11.2014 09:46
Moonsoft Team
www.moonsoft.es