dbQuery
Client-side
Server-side
Shared
This page is incomplete! Help wanted!
Please finish this page using the corresponding Old Wiki article.
Go to Contribution guidelines for more information.
This function starts a database query using the supplied connection. Use the returned query handle with dbPoll to get the result, or dbFree if you don't want the result.
Tip
The server command debugdb 2 will output verbose information on each query to a logging file (usually logs/db.log )
Important
It is strongly recommended to use this function asynchronously, as presented in "This example starts a select query and processes the result in an inline callback function with custom arguments:"
Syntax
dbQuery ( )Code Examples
server
This example starts an INSERT query and frees the result:
local qh = dbQuery( connection, "INSERT INTO table_name VALUES (?,?,?)", "aaa", "bbb", 10 )dbFree( qh )