Database
db_query:execute
Server
Commits the prepared query on the database
Syntax
local status = db_query:execute()Parameters
| Type | Name | Description |
|---|
Returns
| Type | Name | Description |
|---|---|---|
bool | status | true on successful execution, or false on failure |
Examples
local db = database.create("127.0.0.1", "root", "", "vital_sandbox")
--Insert a new player record
db:table("players")
:insert({ name = "aviril", score = 0 })
:execute()
--Update the score for a specific player
db:table("players")
:update({ score = 500 })
:where("name", "=", "aviril")
:execute()
--Delete a specific player record
db:table("players")
:delete()
:where("name", "=", "aviril")
:execute()