Welcome Guest, Not a member yet? Register   Sign In
form_dropdown not working strange!!
#1

[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?




Theme © iAndrew 2016 - Forum software by © MyBB