Я пытаюсь использовать функцию Insert_id, но она не работает. Он возвращает 0 для $last_id.
$query = "INSERT INTO ... ";
$data = $this->query($query);
$last_id=$this->insert_id;
Я также пробовал
$last_id=$this->db->insert_id; // ,
$last_id=$this->db->insert_id(); // and with
$last_id=$this->insert_id();
Подробнее здесь: https://stackoverflow.com/questions/790 ... -last-auto
Мобильная версия