mirror of
https://github.com/darksaid98/overextended.github.io.git
synced 2026-12-02 06:28:54 +00:00
finish moving ox_mysql docs
This commit is contained in:
1 parent
7f636ad7e7
commit
b912eec843
6 files changed
+231
-227
No files matched your search
@@ -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)
|
||||
})()
|
||||
```
|
||||
Reference in new issue
Block a user