Method Global:PlayerbotsDBQueryAsync [-] [+]
Executes an asynchronous SQL query on the playerbots database and passes an ALEQuery to a callback function.
The query is executed asynchronously (i.e. the server keeps running while the query is executed in parallel, and results are passed to a callback function). If you need to execute the query synchronously, use Global:PlayerbotsDBQuery instead.
PlayerbotsDBQueryAsync("SELECT id, x, y, z FROM playerbots_travelnode WHERE map_id = 0", function(Q)
if Q then
repeat
print(Q:GetUInt32(0), Q:GetFloat(1), Q:GetFloat(2), Q:GetFloat(3))
until not Q:NextRow()
end
end)
Synopsis
PlayerbotsDBQueryAsync( sql, callback )
Arguments
string sqlQuery to execute.
function callbackFunction that will be called when the results are available.
Returns
Nothing.