simple query in render_table method

Hi,
I’m trying to write a simple query in render_table method to popolate the unit list, but I can’t.

$list->render_table(“SELECT id, name FROM persons”, “id”, “id(value), name(label)”);

If instead, I use code below, working properly
$list->render_table(“persons”, “id”,“id(value), name(label)”);

Any help is greatly appreciated.

Igor

In case of render_sql code must be like next

$list->render_table("SELECT id, id as value, name as label FROM persons", "id", "id(value), name(label)");

thank you so much, Stanislav