Welcome Guest, Not a member yet? Register   Sign In
$this->db->insert($_POST); Is there a way to exclude one field?
#11

[eluser]TheFuzzy0ne[/eluser]
How about doing it the other way? Simply loop through the allowed values, and extract them from the $input array? That should be more efficient.

Code:
function prep_set($input,$allowed)
{
   $output = array();

   foreach($allowed as $key)
   {
      if(in_array($key,$input))
      {
          $output[$key] = $input['key'];
      }
   }

   return $output;
}

EDIT: I really think that we need a this->input->all_post(), or that $this->input->post() should return the entire post array if no values are specified.


Messages In This Thread
$this->db->insert($_POST); Is there a way to exclude one field? - by El Forum - 04-29-2009, 07:12 AM



Theme © iAndrew 2016 - Forum software by © MyBB