Include some js samples

This commit is contained in:
Linden committed 2021-09-19 07:35:49 +10:00
1 parent 7ac73ccdb4
commit 93754a8efc
6 files changed
+60 -26

No files matched your search

+10 -4
View File
@@ -1,14 +1,20 @@
# Update
Execute a query and returns the number of affected rows.
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)
print('I will be printed before query result')
```
```lua
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`)
```