[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