Joomla Platform  13.1
Documentation des API du framework Joomla Platform
 Tout Classes Espaces de nommage Fichiers Fonctions Variables Pages
with

Method to get the auto-incremented value from the last INSERT statement. To be called after the INSERT statement, it's MANDATORY to have a sequence on every primary key table.

To get the auto incremented value it's possible to call this function after INSERT INTO query, or use INSERT INTO with RETURNING clause.

insertid() call: $query = $this->getQuery(true) ->insert('jos_dbtest') ->columns('title,start_date,description') ->values("'testTitle2nd','1971-01-01','testDescription2nd'"); $this->setQuery($query); $this->execute(); $id = $this->insertid();