mariadb get query string: Difference between revisions

From Onset Developer Wiki
28days (talk | contribs)
No edit summary
No edit summary
 
Line 2: Line 2:
{{Notice|This function is provided by the official [[MariaDB]] plugin.}}
{{Notice|This function is provided by the official [[MariaDB]] plugin.}}


{{FuncDescription|__EDIT_ME__}}
{{FuncDescription|Gets the query string of the active result.}}


{{FuncSyntax|mariadb_get_query_string()}}
{{FuncSyntax|mariadb_get_query_string()}}
Line 9: Line 9:
{{FuncNoParam}}
{{FuncNoParam}}


{{FuncReturnValue|__EDIT_ME__}}
{{FuncReturnValue|Returns the query string.}}


== Example ==
== Example ==
<syntaxhighlight lang="Lua">
<syntaxhighlight lang="Lua">
-- code
function LoadVehicle()
    local query = mariadb_prepare(sql, "SELECT * FROM vehicles WHERE id = 1;")
    mariadb_async_query(sql, query, OnLoadVehicle)
end
 
function OnLoadVehicle()
    local query = mariadb_get_query_string()
    print("The query was: ", query)
end
</syntaxhighlight>
</syntaxhighlight>


{{RelatedFunctions}}
{{RelatedFunctions}}
{{MariaDBFunctions}}
{{MariaDBFunctions}}

Latest revision as of 08:43, 2 September 2020

mariadb get query string

Type: Function
Context: Server
Introduced: v1.0

NOTICE

This function is provided by the official MariaDB plugin.

Description

Gets the query string of the active result.

Syntax

mariadb_get_query_string()

Parameters

  • This function has no parameters.

Return Value

  • Returns the query string.

Example

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

function OnLoadVehicle()
    local query = mariadb_get_query_string()
    print("The query was: ", query)
end

See also