PMA\libraries\DatabaseInterface::insertId PHP Метод

insertId() публичный Метод

returns last inserted auto_increment id for given $link or $GLOBALS['userlink']
public insertId ( object $link = null ) : integer | boolean
$link object the connection object
Результат integer | boolean
    public function insertId($link = null)
    {
        $link = $this->getLink($link);
        if ($link === false) {
            return false;
        }
        // If the primary key is BIGINT we get an incorrect result
        // (sometimes negative, sometimes positive)
        // and in the present function we don't know if the PK is BIGINT
        // so better play safe and use LAST_INSERT_ID()
        //
        // When no controluser is defined, using mysqli_insert_id($link)
        // does not always return the last insert id due to a mixup with
        // the tracking mechanism, but this works:
        return $this->fetchValue('SELECT LAST_INSERT_ID();', 0, 0, $link);
    }