mirror of
https://github.com/darksaid98/oxmysql.git
synced 2026-12-01 22:21:51 +00:00
21 lines
536 B
Markdown
21 lines
536 B
Markdown
# Update
|
|
Execute a query and returns the number of affected rows when updating rows.
|
|
|
|
### Usage
|
|
```lua
|
|
exports.oxmysql:update(query, {}, function(affectedRows)
|
|
print('Updated '..affectedRows..' rows')
|
|
end)
|
|
|
|
local affectedRows = exports.oxmysql:updateSync(query, {})
|
|
print('Updated '..affectedRows..' rows')
|
|
```
|
|
```js
|
|
exports.oxmysql.update(query, {}, (affectedRows) => {
|
|
console.log(`Updated ${affectedRows} rows`)
|
|
})
|
|
|
|
const affectedRows = await exports.oxmysql.updateSync(query, {})
|
|
console.log(`Updated ${affectedRows} rows`)
|
|
```
|