dongzun9958 2013-05-08 00:00
浏览 28

在Codeigniter中验证现有记录的数据

I have encountered an issue on which I haven't found much documentation online. I'm hopeful the SO community will have some advice.

I am currently trying to build a Profile Update page, which doesn't require that all of the fields are to be required. In other words, I'm hoping to set rules with *$this->form_validation->set_rules()* for all fields, but understanding that only a few fields will be populated and sent. The idea being that, if a field has been modified, then it is assumed to be updated.

How can I achieve this?

Edit 1: Trying to allow a user to update their profile. The profile already exists, but they might not submit all fields when updating so the ones that are "required" would reject, no?

No code - I'm asking how to even approach the conundrum. Thanks!

Thanks!

-E

  • 写回答

1条回答 默认 最新

  • duangu4943 2013-05-09 01:45
    关注

    Compare sended values and database values before updating. Do not update if they are all same.

    评论

报告相同问题?