How do I find out the id of the row I just inserted?
Answer Posted / 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 |
Post New Answer View All Answers