This example show you how to:
<select id="country_id" class="mSelect" multiple="multiple"></select>
$(function () {
$('#country_id').mSelect({
url: 'ajax/example6.php',
ajax_var_name: 'my_id',
btnSelected:{
enable: true
}
});
});
<?php
//........
// get the selected rows ids
$selectedIds = isset($_GET['my_id']) && !empty($_GET['my_id']) ? $_GET['my_id'] : [];
$whereResult = !empty($selectedIds) ? "id IN($selectedIds)" : null;
echo json_encode(
Datatables::complex($_GET, $sql_details, $table, $primaryKey, $columns, $whereResult, $whereAll = null)
);
?>