I have a question regarding the insertion, change and removal of the records in the MySql database. For example, imagine a table of notes where all the information in this note, such as supplier data, carrier data and taxes to be collected, is entered. And we also have a nota_itens table, where the items in this note will be inserted. Well, in structured PHP, I would do the following: First I would do an INSERT to register the data of the note table and then I would do another INSERT to register the data of the nota_notes table with the last id of the note table in the nota_notes table referencing then the two tables. My question is as follows, in CodeIgniter Framework is there any mechanism or function that does this automatically? Or do I have to implement the same idea of structured PHP? I hope to have been clear in my doubt and thank you!