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

#2
[eluser]C. Jiménez[/eluser]
You can pre-process your result array in model to send expected data to your controller.
Code:
public function get_titles ()
{
$query = = $this->db->query('SELECT `id`, `name` FROM `employee` WHERE `pos_code` IN (6, 7, 8, 9)');
$raw_data =  $query -> result_array ();
foreach ($raw_data as $line){
             $dropdown_array[$line['id']] = $line['name']
             }
return $dropdown_array;
}


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.