It looks like you're new here. If you want to get involved, click one of these buttons!
Hi,
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
$this->tests_model->save($test_new);
// 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.
Comments
You can use:
Works! Thank you.