Yeah now throw in that you want the input field already filled with a database entry. See how your form_input handles that
Oh, I think I can answer that:
$data['field_name_value'] = (isset($_POST['field_name'])) ? $this->input->post('field_name') : $result->field_name;
echo form_input('field_name', set_value('field_name',htmlspecialchars($field_name_value)));
Actually, this is all you have to do:
echo form_input('field_name', set_value('field_name', $result->field_name));
It uses the post value, if there is one. If not, it defaults to $result->field_name. Also, you don’t need to escape with htmlspecialchars. The helper does that for you.