I am currently structuring my queries for a database update model with CodeIgniter.
I getting the form posted input keys with $keys = array_keys($_POST)
To update according database fields I was wanting to do something like this
foreach($keys as $key){
$data = $this->input->post($key);
$this->db->query("Update $table SET '$key'='$data' WHERE user_id='$the_user->id'"); }
(this is not production code, just trying to illustrate my question, hence no escaping, validation, etc...)
My question is, does this pose a performace problem by running a seperate query for each individual piece of form data submitted?
EDIT: sorry didn't intend for it to sound like a yes or no question, obviously if yes or no, the answer is yes, but I am looking for more of to what degree does it hamper the performance?