Scalar
Returns the first column for a single row.
Example
=== "Lua === "Async"
exports.oxmysql:scalar('SELECT firstname FROM users WHERE identifier = ?', {playerIdentifier}, function(result)
if result then
print(result.firstname)
end
end)
local result = exports.oxmysql:scalarSync('SELECT firstname FROM users WHERE identifier = ?', {playerIdentifier})
if result then
print(result.firstname)
end
exports.oxmysql.scalar('SELECT firstname FROM users WHERE identifier = ?', [playerIdentifier], function(result) {
if (result)
console.log(result.firstname)
})
const result = exports.oxmysql.scalarSync('SELECT firstname FROM users WHERE identifier = ?', [playerIdentifier]) {
if (result)
console.log(result.firstname)