Welcome Guest, Not a member yet? Register   Sign In
Return manipulated form data from model to controller.
#1

[eluser]Unknown[/eluser]
Hey Everybody,
I'm using the excellent form generation library and have forms submit to a function in MY_Model that takes the data and table name and runs a bunch of tests and array manipulation. One of which determines whether it's an update or insert statement and saves the $data['ID'] or $this->db->insert_id() and returns the entire array. The end goal is to have a validated form in the controller redirect the url to /path/to/ID/# and always be right, regardless of it being a new insert or an update function. I also have a problem when a secondary insert happens after the initial query, in which case $this->db->insert_id() returns the wrong ID in the controller.

Any ideas? I'm trying to avoid running test to see if $this->db->insert_id() is set on each and every form, probably 3-400 in total. Thanks for your help and a wonderful product!


Messages In This Thread
Return manipulated form data from model to controller. - by El Forum - 09-25-2012, 07:00 AM
Return manipulated form data from model to controller. - by El Forum - 09-25-2012, 08:15 AM



Theme © iAndrew 2016 - Forum software by © MyBB