mirror of
https://github.com/darksaid98/oxmysql.git
synced 2026-12-03 06:28:53 +00:00
Include some js samples
This commit is contained in:
1 parent
7ac73ccdb4
commit
93754a8efc
6 files changed
+60
-26
No files matched your search
@@ -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`)
|
||||
```
|
||||
Reference in new issue
Block a user