Vital.sandbox
Database

db_query:execute

Server

Commits the prepared query on the database


Syntax

local status = db_query:execute()

Parameters

TypeNameDescription

Returns

TypeNameDescription
boolstatustrue 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()

On this page