mariadb get insert id

From Onset Developer Wiki
Revision as of 13:53, 20 November 2019 by 28days (talk | contribs)
mariadb get insert id

Type: Function
Context: Server
Introduced: v1.0

NOTICE

This function is provided by the official MariaDB plugin.

Description

Retrieves the ID generated for an AUTO_INCREMENT column by the sent query (usually INSERT).

Syntax

mariadb_get_insert_id()

Parameters

  • This function has no parameters.

Return Value

  • new ID generated for an AUTO_INCREMENT column, false on error.

Example

local player_sqlid = mariadb_get_insert_id()
print("A new player with #"..player_sqlid.." has registered.")

See also