[eluser]Unknown[/eluser]
Hi,
I am new with PHP and specialy with CodeIgniter, but I have to develop a web interface to do a query in a database and show the results to the user.
Right now I am trying to use the form_dropdown from the form_helper. I searched a bit in this forum and founded something useful for me now, but I am not getting it to work properly. The dropdown list is from a query in the database. But the form is not showing up. Can someone give me a help?
Right below is the View code:
Code:
<?php
$values = $this->db
->select('TIPO_ELEMENTO')
->get('SYRIP')
->result_array();
$options = array();
foreach($values as $value)
{
$options[$value['TIPO_ELEMENTO']] = $value['TIPO_ELEMENTO'];
}
return $options;
echo form_dropdown('TesteTipo',$options,null);