Welcome Guest, Not a member yet? Register   Sign In
Exclude insertion in the database.....($this->db->insert($table, $_POST))
#2

[eluser]PhilTem[/eluser]
Do
Code:
unset($_POST['input_key_to_unset']);
$this->db->insert($table, $_POST);


which is the easiest way. Of course you can have an array representing all fields of your table and then clean the $_POST with

Code:
$cleaned_post = array_intersect($table_fields, $_POST);

assuming you have same names for both the table-fields as well as the input-fields.
Refer to http://php.net/manual/en/function.array-...ct-key.php for more info.


Messages In This Thread
Exclude insertion in the database.....($this->db->insert($table, $_POST)) - by El Forum - 02-29-2012, 01:11 AM



Theme © iAndrew 2016 - Forum software by © MyBB