0

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.

yeshansachithak
  • 832
  • 2
  • 18
  • 34

1 Answers1

0

As the Ci Bonfire works on the codeignitor frame work so you can run the mysql Query using the codeignitor class.

Please follow the below URL. http://ellislab.com/codeigniter/user-guide/database/queries.html

JIT1986
  • 682
  • 6
  • 9