• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Associative Array Argument for form_dropdown()

#1
[eluser]kaege[/eluser]
Hello Smile
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.


Messages In This Thread
Associative Array Argument for form_dropdown() - by El Forum - 07-10-2011, 10:11 PM
Associative Array Argument for form_dropdown() - by El Forum - 07-11-2011, 01:31 AM

Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  


  Theme © 2014 iAndrew  
Powered By MyBB, © 2002-2021 MyBB Group.