mariadb get warning count

From Onset Developer Wiki
mariadb get warning count

Type: Function
Context: Server
Introduced: v1.0

NOTICE

This function is provided by the official MariaDB plugin.

Description

Returns the number of warnings the sent query generated.

Syntax

mariadb_get_warning_count()

Parameters

  • This function has no parameters.

Return Value

  • Number of warnings, false on error.

Example

function LoadVehicle()
    local query = mariadb_prepare(sql, "SELECT * FROM vehicles WHERE id = 1;")
    mariadb_async_query(sql, query, OnLoadVehicle)
end

function OnLoadVehicle()
    local warnings = mariadb_get_warning_count()
    print("This query had"..warnings.." warnings")
end

See also