CodeIgniter Forums
form_dropdown not working strange!! - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: Archived Discussions (https://forum.codeigniter.com/forumdisplay.php?fid=20)
+--- Forum: Archived Development & Programming (https://forum.codeigniter.com/forumdisplay.php?fid=23)
+--- Thread: form_dropdown not working strange!! (/showthread.php?tid=47485)



form_dropdown not working strange!! - El Forum - 12-10-2011

[eluser]the_unforgiven[/eluser]
Hi Guys,

I have this code in one of me view files:

Code:
<?php
$values = $this->db
  ->select('ProductID, Product')
  ->get('tblProduct')
  ->result_array();
$options = array();
//loop over the retrieved results
foreach($values as $value)
{
  $options = $value['Product'];
}
return $options;
?>

But when I call it via the dropdown like so:

Code:
<tr><td>Product:</td><td>&lt;?php echo form_dropdown('Product', $options['Product'], set_value('Product')); ?&gt;</td></tr>

It just shows nothing but a blank page like I have missed a ; or something but haven't but yet when i do print($options); all the options are there, so any idea's why it doesn't work in my dropdown menu?