I wanna display this query result as form_dropdown
Model
public function deptlist_view() { $this -> load -> database(); $query = $this -> db -> query('select var_staffdepartment from tbl_admin'); return $query -> result(); } Controller
public function view_dept() { $this -> load -> model('model_database'); $deptdata['query'] = $this -> model_users -> deptlist_view(); $this -> load -> view('signup', $deptdata); } View
<?php $dept= ???? ?> <?php echo form_open('welcome/signup_validation'); ?> <table align="center"> <tr> <td> <p> Departments :</p> </td> <td><?php echo form_dropdown('staffdept', $dept); ?></td> </table> <?php echo form_close(); ?> Could you please show how to fix this Problem? It would be very helpfull. thanks in advance.