[eluser]=G-Man=[/eluser]
I'm pretty new my self, but i was looking at the for_dropdown() and it wants an array, the problem is the query, even with query->result_array(), will only return one line in the DB at a time, so you would have to build code to go through the results and make another array of ALL the data, so might be more work then needed.
what I can do is show you my code (for a almost the exact thing), and you can mabey tweak it.
Controller
Code:
<?
class Header extends Controller
{
function index()
{
$data['query'] = $this->db->get("admin_servers");
$this->load->view('header_view', $data);
}
}
?>
View
Code:
<form action="<?= site_url("/server/changeserver"); ?>" method="post" name="changeserver">
Server:
<select name="server" onChange="TestServer()">
<option value="0">Select Server</option>
<? foreach($query->result() as $server): ?>
<option value="<?=$server->id;?>" <? if($this->session->userdata('server') == $server->id) { echo ("selected=\"selected\"");} ?>>
<?=$server->name;?>
</option>
<? endforeach; ?>
</select>
</form>
hope i helps, or there might be a built in function to get the entire result in an array in one command (would be nice
)