mirror of
https://github.com/darksaid98/oxmysql.git
synced 2026-12-03 06:28:53 +00:00
New documentation
This commit is contained in:
commit
5bcec3a0b1
16 files changed
+609
No files matched your search
@@ -0,0 +1,36 @@
|
||||
---
|
||||
title: Update
|
||||
---
|
||||
Updates an entry in the database and returns the number of affected rows.
|
||||
|
||||
!!! info "Example"
|
||||
=== "Lua
|
||||
=== "Async"
|
||||
```lua
|
||||
exports.oxmysql:insert('UPDATE users SET firstname = ? WHERE identifier = ? ', {newName, playerIdentifier}, function(affectedRows)
|
||||
if affectedRows then
|
||||
print(affectedRows)
|
||||
end
|
||||
end)
|
||||
```
|
||||
=== "Sync"
|
||||
```lua
|
||||
local id = exports.oxmysql:insertSync('UPDATE users SET firstname = ? WHERE identifier = ? ', {newName, playerIdentifier})
|
||||
if affectedRows then
|
||||
print(affectedRows)
|
||||
end
|
||||
```
|
||||
=== "JavaScript
|
||||
=== "Async"
|
||||
```js
|
||||
exports.oxmysql.insert('UPDATE users SET firstname = ? WHERE identifier = ? ', [newName, playerIdentifier], function(affectedRows) {
|
||||
if (affectedRows)
|
||||
console.log(affectedRows)
|
||||
})
|
||||
```
|
||||
=== "Sync"
|
||||
```js
|
||||
const id = exports.oxmysql.insertSync('UPDATE users SET firstname = ? WHERE identifier = ? ', [newName, playerIdentifier]) {
|
||||
if (affectedRows)
|
||||
console.log(affectedRows)
|
||||
```
|
||||
Reference in new issue
Block a user