This commit is contained in:
Linden committed 2023-05-23 02:16:59 +10:00
1 parent daf6a505fc
commit d2753fb2fd
10 files changed
+47 -10

No files matched your search

+8 -4
View File
@@ -1,3 +1,7 @@
---
keywords: ['execute']
---
# Update
Returns the number of affected rows by the query.
@@ -40,9 +44,9 @@ end
MySQL.update('UPDATE users SET firstname = ? WHERE identifier = ? ', [newName, playerIdentifier], (affectedRows) => {
if (affectedRows) {
console.log(affectedRows)
console.log(affectedRows);
}
})
});
```
### Promise
@@ -50,8 +54,8 @@ MySQL.update('UPDATE users SET firstname = ? WHERE identifier = ? ', [newName, p
```js
// alias: exports.oxmysql.update_async
const id = MySQL.update('UPDATE users SET firstname = ? WHERE identifier = ? ', [newName, playerIdentifier])
const id = MySQL.update('UPDATE users SET firstname = ? WHERE identifier = ? ', [newName, playerIdentifier]);
if (affectedRows) {
console.log(affectedRows)
console.log(affectedRows);
}
```