update oxmysql js usage

and somewhat clean up transaction docs
This commit is contained in:
Linden committed 2022-07-12 15:21:32 +10:00
1 parent 1363afcd2a
commit 3d627ba762
8 files changed
+178 -81

No files matched your search

+6 -2
View File
@@ -30,7 +30,9 @@ end
### Callback
```js
exports.oxmysql.update('UPDATE users SET firstname = ? WHERE identifier = ? ', [newName, playerIdentifier], (affectedRows) => {
// alias: exports.oxmysql.update
MySQL.update('UPDATE users SET firstname = ? WHERE identifier = ? ', [newName, playerIdentifier], (affectedRows) => {
if (affectedRows) {
console.log(affectedRows)
}
@@ -39,7 +41,9 @@ exports.oxmysql.update('UPDATE users SET firstname = ? WHERE identifier = ? ', [
### Promise
```js
const id = exports.oxmysql.update_async('UPDATE users SET firstname = ? WHERE identifier = ? ', [newName, playerIdentifier])
// alias: exports.oxmysql.update_async
const id = MySQL.update('UPDATE users SET firstname = ? WHERE identifier = ? ', [newName, playerIdentifier])
if (affectedRows) {
console.log(affectedRows)
}