Skip to content

Scalar

Returns the first column for a single row.

Example

Async

exports.oxmysql:scalar('SELECT firstname FROM users WHERE identifier = ?', {playerIdentifier}, function(result)
    if result then
        print(result.firstname)
    end
end)

Sync

local result = exports.oxmysql:scalarSync('SELECT firstname FROM users WHERE identifier = ?', {playerIdentifier})
if result then
    print(result.firstname)
end

Async

exports.oxmysql.scalar('SELECT firstname FROM users WHERE identifier = ?', [playerIdentifier], function(result) {
  if (result)
    console.log(result.firstname)
})

Sync

const result = exports.oxmysql.scalarSync('SELECT firstname FROM users WHERE identifier = ?', [playerIdentifier]) {
if (result)
  console.log(result.firstname)
Back to top