How do I find out the id of the row I just inserted?
Answer / Ashish Joshi
To get the ID of the row you just inserted using CodeIgniter's Active Record, you can use the insert_id() method. Here's an example:nn```phpn$data = array('column1' => 'value1', 'column2' => 'value2');n$this->db->insert('table_name', $data);n$inserted_id = $this->db->insert_id(); // The ID of the newly inserted rown```
| Is This Answer Correct ? | 0 Yes | 0 No |
What is library in codeigniter?
Why is there a need to configure the url routes?
What is the default controller used in codeigniter?
Explain views in codeigniter?
Why codeigniter is used?
What is the use of hooks in codeigniter?
How to create a driver in codeigniter?
How you will use or add codeigniter libraries?
Which is better codeigniter or laravel?
How we can load multiple helper files in codelgniter?
What are codeigniter security methods?
How can you extend a class in codeigniter?