Welcome Guest, Not a member yet? Register   Sign In
Updating Multiple Rows in One Table...
#2

[eluser]tonanbarbarian[/eluser]
I have never had any issues using $this->db->escape. Which database are you connecting to?

as for the first method if you want to do it safely try
Code:
foreach(array_keys($_POST) as $key) {
      $val = $this->input->post($key, true);
      $this->db->where('variable', $key);
      $this->db->update('settings', $val);
      }
so all we are doing here is looking at the keys in the POST and using the keys with the $this->input-post and forcing XSS_CLEAN on each post variable.


Messages In This Thread
Updating Multiple Rows in One Table... - by El Forum - 12-27-2007, 03:31 PM
Updating Multiple Rows in One Table... - by El Forum - 12-27-2007, 04:15 PM
Updating Multiple Rows in One Table... - by El Forum - 12-27-2007, 05:21 PM
Updating Multiple Rows in One Table... - by El Forum - 12-27-2007, 05:43 PM
Updating Multiple Rows in One Table... - by El Forum - 12-27-2007, 05:58 PM



Theme © iAndrew 2016 - Forum software by © MyBB