• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
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


Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  


  Theme © 2014 iAndrew  
Powered By MyBB, © 2002-2021 MyBB Group.