Welcome Guest, Not a member yet? Register   Sign In
retrieve data
#1

[eluser]Unknown[/eluser]
I have a crud, and when I bring data to populate a ALTER form, I bring all data correct and populate the inputs correct, but I don't know how to populate a dropdown...

I'm doing this way

The inputs that is correct
Code:
echo form_input('title',$data_news[0]->title);

My dropdown(wrong)

Code:
foreach($category as $item)
{
   $drop[$item->id] = $item->name;
}
!set_value('category') ? $selected = null : $selected = set_value('category');
echo form_dropdown('category',$drop,$selected);

it shows the options correcty, but don't bring it with the select option that is in the database


Messages In This Thread
retrieve data - by El Forum - 09-29-2011, 06:50 AM



Theme © iAndrew 2016 - Forum software by © MyBB