Welcome Guest, Not a member yet? Register   Sign In
Return last inserted ID
#4

[eluser]LuckyFella73[/eluser]
As far as I know you can access the last insert id from controller
direcly (after calling the model) without returning the id from
your model.
Code:
# controller:

// call you model
$this->addressbook_model->add_new_address();
// you don't need to write "$_POST" here
// POST data is available in your model

// and then (still controller)
$insert_id = $this->db->insert_id();

Is there a special reason why you try to return the
post data from your model back to tha controller? I mean, the post
data is available anyway.


Messages In This Thread
Return last inserted ID - by El Forum - 07-26-2009, 12:46 PM
Return last inserted ID - by El Forum - 07-26-2009, 01:15 PM
Return last inserted ID - by El Forum - 07-26-2009, 01:39 PM
Return last inserted ID - by El Forum - 07-26-2009, 02:29 PM
Return last inserted ID - by El Forum - 07-26-2009, 04:30 PM
Return last inserted ID - by El Forum - 07-27-2009, 08:54 AM
Return last inserted ID - by El Forum - 07-27-2009, 09:15 AM
Return last inserted ID - by El Forum - 07-27-2009, 09:21 AM



Theme © iAndrew 2016 - Forum software by © MyBB