I have this code on my PHP test file. Now I need to do it in my CI-Bonfire application. I used find_by() and find_all()
but, I didn't get any result that I want.
<?php
$result2 = mysql_query('SELECT * FROM its1_dms_users LEFT JOIN its1_dms_roles ON its1_dms_users.role_id=its1_dms_roles.role_id WHERE its1_dms_users.deleted=0 AND its1_dms_users.banned=0 AND its1_dms_users.active=1');
print "<select name='Notice' multiple size='10'>";
while ($roles = mysql_fetch_assoc($result2)){
print "<optgroup label='" . $roles['role_name'] . "'>";
print "<option value='" . $roles['id'] . "'>" . $roles['display_name'] . "</option>";
print "</optgroup>";
}
print "</select>";
?>
I just need to know. How I run that Query in CI-Bonfire in My Modules Controller.