multiselect list options from db

I’d like to use the CONCAT function to join two fields in order to display the concatenated info as the ‘label info’ for a list box in my lightbox form.

Here is my php code:

$list = new OptionsConnector($res);
	$list->render_sql("select 'ID', CONCAT('ID', 'DATE') AS Info FROM promos AS promos ORDER BY Date Desc","ID","ID(value),Info(label)");
	$scheduler->set_options("promos", $list);

On my lightbox in the scheduler, nothing displays. Just blank information.

And this doesn’t work:

$list = new OptionsConnector($res);
	$list->render_table("promos","ID","ID(value),CONCAT(ID, Date)(label)");
	$scheduler->set_options("promos", $list);

Hello,

Check following example:

$list->render_sql("SELECT typeid as value, CONCAT(typeid, ': ', name) as label FROM types", "typeid", "value, label");

Result:

<coll_options for="type"> <item value="1" label="1: Simple"/> <item value="2" label="2: Complex"/> <item value="3" label="3: Unknown"/> </coll_options>
Best regards,
Ilya

Works great! Thanks!