Progetto H — API Reference API & Scripting Documentation

Funzioni & API Esportate 1

MetaMySQL.Query

Server
MetaMySQL.Query(sql, params, callback)
Executes a SELECT query with prepared placeholders (:0, :1) and returns row array.

Parametri & Opzioni

Parametro Tipo Stato Descrizione
sql string Obbligatorio SQL statement with :0, :1 placeholders.
params any[] Opzionale (default: {}) Parameters array.
callback function(rows, err) Obbligatorio Result callback.

Valore di Ritorno

void — No return value.

Esempio d'Uso

Esempio Lua
MetaMySQL.Query("SELECT * FROM users WHERE identifier = :0 LIMIT 1", { "char1:7656..." }, function(rows, err)
    if rows and #rows > 0 then Console.Log("Found user: %s", rows[1].firstname) end
end)