Files
overextended.github.io/docs/oxmysql/Usage/update.md
T
2023-05-31 21:23:24 +10:00

1.2 KiB

keywords, title
keywords title
execute
Update

import Tabs from '@theme/Tabs'; import TabItem from '@theme/TabItem';

Returns the number of rows affected by the query.

Promise

local affectedRows = MySQL.update.await('UPDATE users SET firstname = ? WHERE identifier = ?', {
    newName, identifier
})

print(affectedRows)
const affectedRows = await MySQL.update('UPDATE users SET firstname = ? WHERE identifier = ?', [
  newName, identifier
])

console.log(affectedRows)

Aliases

  • MySQL.Sync.execute
  • exports.ghmattimysql.executeSync
  • exports.oxmysql.update_async

Callback

MySQL.update('UPDATE users SET firstname = ? WHERE identifier = ?', {
    newName, identifier
}, function(affectedRows)
    print(affectedRows)
end)
MySQL.update('UPDATE users SET firstname = ? WHERE identifier = ?', [
  newName, identifier
], (affectedRows) => {
  console.log(affectedRows)
})

Aliases

  • MySQL.Async.execute
  • exports.ghmattimysql.execute
  • exports.oxmysql.update