finish moving ox_mysql docs

This commit is contained in:
N-fire committed 2022-03-02 13:40:28 +01:00
1 parent 7f636ad7e7
commit b912eec843
6 files changed
+231 -227

No files matched your search

+16 -16
View File
@@ -3,7 +3,7 @@ title: insert
---
Inserts a new entry into the database and returns the insert id for the row, if valid.
:::tip Example
:::info Example
Lua
**Callback**
@@ -23,19 +23,19 @@ local id = MySQL.insert.await('INSERT INTO users (identifier, firstname, lastnam
print(id)
end)
```
=== JavaScript"
**Callback**
```js
exports.oxmysql.insert('INSERT INTO users (identifier, firstname, lastname) VALUES (?, ?, ?) ', [playerIdentifier,
firstName, lastName], function(id) {
console.log(id)
})
```
**Promise**
```js
(async () => {
const id = exports.oxmysql.insert_async('INSERT INTO users (identifier, firstname, lastname) VALUES (?, ?, ?) ',
JavaScript
**Callback**
```js
exports.oxmysql.insert('INSERT INTO users (identifier, firstname, lastname) VALUES (?, ?, ?) ', [playerIdentifier, firstName, lastName], function(id) {
console.log(id)
})
```
**Promise**
```js
(async () => {
const id = exports.oxmysql.insert_async('INSERT INTO users (identifier, firstname, lastname) VALUES (?, ?, ?) ',
[playerIdentifier, firstName, lastName]) {
console.log(id)
})()
```
console.log(id)
})()
```