Include some js samples

This commit is contained in:
Linden committed 2021-09-19 07:35:49 +10:00
1 parent 7ac73ccdb4
commit 93754a8efc
6 files changed
+60 -26

No files matched your search

+11 -5
View File
@@ -4,11 +4,17 @@ Execute a query and return the results of the first row.
### Usage
```lua
exports.oxmysql:single(query, {}, function(result)
print(result['column'])
print(result.column1, result.column2)
end)
print('I will be printed before query result')
```
```lua
local result = exports.oxmysql:singleSync(query, {})
print(result['column'])
print(result.column1, result.column2)
```
```js
exports.oxmysql.single(query, {}, (result) => {
console.log(result.column1, result.column2)
})
const result = await exports.oxmysql.singleSync(query, {})
console.log(result.column1, result.column2)
```