From 89e41be3c0f4fc64b8f2de12e032cec52cdc7673 Mon Sep 17 00:00:00 2001 From: Linden <65407488+thelindat@users.noreply.github.com> Date: Wed, 27 Oct 2021 08:13:52 +1100 Subject: [PATCH] Call the correct function for UPDATE --- docs/usage/update.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/docs/usage/update.md b/docs/usage/update.md index 51857ca..873ef98 100644 --- a/docs/usage/update.md +++ b/docs/usage/update.md @@ -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) })