This commit is contained in:
Luke committed 2023-06-04 15:15:21 +02:00
1 parent 3cebaf7fa5
commit b5eba8423f
229 files changed
+6238 -10690

No files matched your search

+74
View File
@@ -0,0 +1,74 @@
---
keywords: ['execute']
title: Update
---
import { Tab, Tabs } from 'nextra-theme-docs';
Returns the number of rows affected by the query.
## Promise
<Tabs items={['Lua', 'JS']}>
<Tab>
```lua
local affectedRows = MySQL.update.await('UPDATE users SET firstname = ? WHERE identifier = ?', {
newName, identifier
})
print(affectedRows)
```
</Tab>
<Tab>
```js
const affectedRows = await MySQL.update('UPDATE users SET firstname = ? WHERE identifier = ?', [
newName, identifier
])
console.log(affectedRows)
```
</Tab>
</Tabs>
**Aliases**
- `MySQL.Sync.execute`
- `exports.ghmattimysql.executeSync`
- `exports.oxmysql.update_async`
## Callback
<Tabs items={['Lua', 'JS']}>
<Tab>
```lua
MySQL.update('UPDATE users SET firstname = ? WHERE identifier = ?', {
newName, identifier
}, function(affectedRows)
print(affectedRows)
end)
```
</Tab>
<Tab>
```js
MySQL.update('UPDATE users SET firstname = ? WHERE identifier = ?', [
newName, identifier
], (affectedRows) => {
console.log(affectedRows)
})
```
</Tab>
</Tabs>
**Aliases**
- `MySQL.Async.execute`
- `exports.ghmattimysql.execute`
- `exports.oxmysql.update`