mirror of
https://github.com/darksaid98/overextended.github.io.git
synced 2026-12-01 22:21:48 +00:00
990 B
990 B
Scalar
Returns the first column for a single row.
Lua
Callback
-- alias: exports.oxmysql:scalar
-- alias: MySQL.Async.fetchScalar
-- alias: exports.ghmattimysql:scalar
MySQL.scalar('SELECT firstname FROM users WHERE identifier = ?', {playerIdentifier}, function(firstname)
print(firstname)
end)
Promise
-- alias: exports.oxmysql:scalar_async
-- alias: MySQL.Sync.fetchScalar
-- alias: exports.ghmattimysql:scalarSync
local firstname = MySQL.scalar.await('SELECT firstname FROM users WHERE identifier = ?', {playerIdentifier})
print(firstname)
JavaScript
Callback
// alias: exports.oxmysql.scalar
MySQL.scalar('SELECT firstname FROM users WHERE identifier = ?', [playerIdentifier], (firstname) => {
console.log(firstname)
})
Promise
// alias: exports.oxmysql.scalar_async
const firstname = await MySQL.scalar('SELECT firstname FROM users WHERE identifier = ?', [playerIdentifier])
console.log(firstname)