Moonsoft Software Solutions

can I use _name from sql option list?

Started 13 Nov 2014 · 2 replies

  1. moon_1855
    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
  2. Moonsoft support
    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
  3. moon_1855
    OK - I already have the query obviously from making the list.
    thanks
    Simon

Still stuck?

Customers with an active license can open a support ticket.

Log in to open a ticket