Hey guys I've been working on this for a few days now but I can't seem to get it to work :(
Here is the situation.
I have an "edit profile" page. On that page you can, like the name implies, edit profile information.
for the example here is what I'm trying to do.
Database record:
||-------||----------||-----------||
|| name || surname || email ||
||-------||----------||-----------||
|| Amy || Nuts || [email protected] ||
||-------||----------||-----------||
I have a form that gives the user the ability to enter their own data and change some of the fields.
The form fields all have names that corrospond with the database fields.
<input name="name" ......
<input name="surname" ......
<input name="email" .....
This is all very logical and easy.
The problem that I have is when I submit the form. I build my website with HTML5 and use placeholders for the form fields. I do this because it looks nice imo and I can experiment some with it. When I just want to update the surname, the other fields stay empty. Codeigniter by default returns a "false" in the case of an empty post item.
Maybe you can see my problem.
When I send the post data to the model and it updates the database record, it will remove the data from the "name" and "email" fields and update the surname.
The array looks like this:
array(
"name" =>
"surname" => NEW
"email" =>
)
After running this through the update function of codeigniter the database record looks like this
||-------||----------||-----------||
|| name || surname || email ||
||-------||----------||-----------||
|| || NEW || ||
||-------||----------||-----------||
what I want to know is, if there is a posibility to let codeigniter ignore the array items that do not have data.
I hope you guys can help out. I'm at a loss here.