How to query from a database for list Units?

Hello!
now, i get list Units from Database:

var sections = scheduler.serverList("type");
		scheduler.createUnitsView({
			name:"unit",
			property:"type",
			list:sections
		});

	$list = new OptionsConnector($res, $dbtype);
	$list->render_table("doctors","id","id(value),first_name(first_name),last_name(last_name),middle_name(middle_name),spec(spec),image(image)");
	
	$scheduler = new schedulerConnector($res, $dbtype);

	$scheduler->set_options("type", $list);

But i want some query from Database for this. No render all values from Databases, just result from “Select *******”
Is it possible? Render_sql? Thank you advance

Hi,
yes, you can use render_sql method for this:

[code]$list = new OptionsConnector($res, $dbtype);
$list->render_sql(
"SELECT * FROM doctors WHERE someColumn > " .$list->sql->escape(“someValue”) . " AND anotherColumn < ". $list->sql->escape(“anotherValue”),
“id”,
“id(value),first_name(first_name),last_name(last_name),middle_name(middle_name),spec(spec),image(image)”
);

$scheduler = new schedulerConnector($res, $dbtype);
$scheduler->set_options(“type”, $list);[/code]
The first parameter takes the sql query, and the rest parameters are the same as in render_table.
Also note that connectors don’t support parameterized queries, but you can use $connector->sql->escape method if you need to insert request values into the query