mirror of
https://github.com/darksaid98/oxmysql.git
synced 2026-12-01 14:38:50 +00:00
Call the correct function for UPDATE
This commit is contained in:
1 parent
db9b1ffb7d
commit
89e41be3c0
1 file changed
+4
-4
@@ -7,7 +7,7 @@ Updates an entry in the database and returns the number of affected rows.
|
||||
=== "Lua"
|
||||
**Async**
|
||||
```lua
|
||||
exports.oxmysql:insert('UPDATE users SET firstname = ? WHERE identifier = ? ', {newName, playerIdentifier}, function(affectedRows)
|
||||
exports.oxmysql:update('UPDATE users SET firstname = ? WHERE identifier = ? ', {newName, playerIdentifier}, function(affectedRows)
|
||||
if affectedRows then
|
||||
print(affectedRows)
|
||||
end
|
||||
@@ -16,7 +16,7 @@ Updates an entry in the database and returns the number of affected rows.
|
||||
**Sync**
|
||||
```lua
|
||||
CreateThread(function()
|
||||
local id = exports.oxmysql:insertSync('UPDATE users SET firstname = ? WHERE identifier = ? ', {newName, playerIdentifier})
|
||||
local id = exports.oxmysql:updateSync('UPDATE users SET firstname = ? WHERE identifier = ? ', {newName, playerIdentifier})
|
||||
if affectedRows then
|
||||
print(affectedRows)
|
||||
end
|
||||
@@ -25,7 +25,7 @@ Updates an entry in the database and returns the number of affected rows.
|
||||
=== "JavaScript"
|
||||
**Async**
|
||||
```js
|
||||
exports.oxmysql.insert('UPDATE users SET firstname = ? WHERE identifier = ? ', [newName, playerIdentifier], function(affectedRows) {
|
||||
exports.oxmysql.update('UPDATE users SET firstname = ? WHERE identifier = ? ', [newName, playerIdentifier], function(affectedRows) {
|
||||
if (affectedRows)
|
||||
console.log(affectedRows)
|
||||
})
|
||||
@@ -33,7 +33,7 @@ Updates an entry in the database and returns the number of affected rows.
|
||||
**Sync**
|
||||
```js
|
||||
setImmediate(async () => {
|
||||
const id = exports.oxmysql.insertSync('UPDATE users SET firstname = ? WHERE identifier = ? ', [newName, playerIdentifier]) {
|
||||
const id = exports.oxmysql.updateSync('UPDATE users SET firstname = ? WHERE identifier = ? ', [newName, playerIdentifier]) {
|
||||
if (affectedRows)
|
||||
console.log(affectedRows)
|
||||
})
|
||||
|
||||
Reference in new issue
Block a user