mirror of
https://github.com/darksaid98/oxmysql.git
synced 2026-12-02 06:28:54 +00:00
Rename directory and fix JS Sync examples
This commit is contained in:
1 parent
2b40fafa7f
commit
9af6205bb7
8 files changed
+3
-3
No files matched your search
@@ -0,0 +1,36 @@
|
||||
---
|
||||
title: Insert
|
||||
---
|
||||
Inserts a new entry into the database and returns the insert id for the row, if valid.
|
||||
|
||||
!!! info "Example"
|
||||
=== "Lua"
|
||||
**Async**
|
||||
```lua
|
||||
exports.oxmysql:insert('INSERT INTO users (identifier, firstname, lastname) VALUES (?, ?, ?) ', {playerIdentifier, firstName, lastName}, function(id)
|
||||
if id then
|
||||
print(id)
|
||||
end
|
||||
end)
|
||||
```
|
||||
**Sync**
|
||||
```lua
|
||||
local id = exports.oxmysql:insertSync('INSERT INTO users (identifier, firstname, lastname) VALUES (?, ?, ?) ', {playerIdentifier, firstName, lastName})
|
||||
if id then
|
||||
print(id)
|
||||
end
|
||||
```
|
||||
=== "JavaScript"
|
||||
**Async**
|
||||
```js
|
||||
exports.oxmysql.insert('INSERT INTO users (identifier, firstname, lastname) VALUES (?, ?, ?) ', [playerIdentifier, firstName, lastName], function(id) {
|
||||
if (id)
|
||||
console.log(id)
|
||||
})
|
||||
```
|
||||
**Sync**
|
||||
```js
|
||||
const id = exports.oxmysql.insertSync('INSERT INTO users (identifier, firstname, lastname) VALUES (?, ?, ?) ', [playerIdentifier, firstName, lastName]) {
|
||||
if (id)
|
||||
console.log(id)
|
||||
```
|
||||
Reference in new issue
Block a user