dbExec
Server
Runs an SQL statement without waiting for an answer.
bool dbExec(element connection, string sql, any ...)
Parameters
| Name | Type | Description |
|---|---|---|
| connection | element | A connection from dbConnect. |
| sql | string | The SQL statement, with ? and ?? as placeholders. |
| ... | any | The placeholders' values: strings, numbers, booleans or nil. |
Returns
true once the statement is sent. If it fails later, the error goes to the server log.
Placeholders
?takes the next value, escaped:nilbecomesNULL, booleans become1or0and strings are quoted.??takes a string as an escaped table or column identifier.- The number of values must match the number of placeholders.
Example
dbExec(db, "UPDATE players SET money = ? WHERE account = ?", 500, accountId)