mirror of
https://github.com/darksaid98/oxmysql.git
synced 2026-12-02 22:22:50 +00:00
Include some js samples
This commit is contained in:
1 parent
7ac73ccdb4
commit
93754a8efc
6 files changed
+60
-26
No files matched your search
@@ -1,14 +1,20 @@
|
||||
# Insert
|
||||
Execute a query and returns the AUTO_INCREMENT id, if it is defined.
|
||||
Execute a query and returns the AUTO_INCREMENT id, if valid.
|
||||
|
||||
### Usage
|
||||
```lua
|
||||
exports.oxmysql:insert(query, {}, function(insertId)
|
||||
print('Inserted new row with id '..insertId)
|
||||
end)
|
||||
print('I will be printed before query result')
|
||||
```
|
||||
```lua
|
||||
|
||||
local insertId = exports.oxmysql:insertSync(query, {})
|
||||
print('Inserted new row with id '..insertId)
|
||||
```
|
||||
```js
|
||||
exports.oxmysql.insert(query, {}, (insertId) => {
|
||||
console.log(`Inserted new row with id ${insertId}`)
|
||||
})
|
||||
|
||||
const insertId = await exports.oxmysql.insertSync(query, {})
|
||||
console.log(`Inserted new row with id ${insertId}`)
|
||||
```
|
||||
Reference in new issue
Block a user