mirror of
https://github.com/darksaid98/overextended.github.io.git
synced 2026-12-01 14:38:50 +00:00
1.0 KiB
1.0 KiB
Update
Returns the number of affected rows by the query.
Lua
Callback
-- alias: exports.oxmysql:update
-- alias: MySQL.Async.execute
MySQL.update('UPDATE users SET firstname = ? WHERE identifier = ?', {newName, playerIdentifier}, function(affectedRows)
if affectedRows then
print(affectedRows)
end
end)
Promise
-- alias: exports.oxmysql:update_async
-- alias: MySQL.Sync.execute
local affectedRows = MySQL.update.await('UPDATE users SET firstname = ? WHERE identifier = ?', {newName, playerIdentifier})
if affectedRows then
print(affectedRows)
end
JavaScript
Callback
exports.oxmysql.update('UPDATE users SET firstname = ? WHERE identifier = ? ', [newName, playerIdentifier], (affectedRows) => {
if (affectedRows) {
console.log(affectedRows)
}
})
Promise
const id = exports.oxmysql.update_async('UPDATE users SET firstname = ? WHERE identifier = ? ', [newName, playerIdentifier])
if (affectedRows) {
console.log(affectedRows)
}