[eluser]kaege[/eluser]
Hello
All of us know that form_dropdown() takes three arguments: a string, an associative array and a boolean value. I wanna ask about the associative array. Take a look at the codes below:
Code:
$result = $this->db->query('SELECT `id`, `name` FROM `employee` WHERE `pos_code` IN (6, 7, 8, 9)');
$row = $result->result_array();
We can access the values with $result[0]['id'] etc, right? But there's one thing that's been bugging me: How to make an associative array whose keys are $result[0]['id'], $result[1]['id'], etc and the values are $result[0]['name'], $result[1]['name'] etc?
I'm sorry if the explanation seems confusing.