Note the upgraded forum! If you are experiencing issues logging in, you may need to reset your password which should send an email. If the email doesn't arrive, be sure to check your spam folder just in case.

How to get $this->example_model->saved() with "id"??

edited May 2019 in Support

I can't figure out how that object should be taken for further process.
Let's assume that "id" in the "tests" table is auto-incremental.
So I'm doing like this:

//new object creation
$test_new = $this->tests_model->create( array('column1' => 'value1', 'column2' => 'value2') );

//saving new object to database

// taking the saved object
$saved_test = $this->tests_model->saved();

This doesn't work for me because returned object doesn't contain the "id" value. How to get the last saved object in the database with "id"?
Please help.


Sign In or Register to comment.